I want to redirect a page with given query string. For example:
- Code: Select all
www.domain.de/?s=bla
=> www.domain.de/bla
If I would have to redirect this page...
- Code: Select all
www.domain.de/index.php?s=bla
=> www.domain.de/bla
...following code will do:
- Code: Select all
RewriteCond %{QUERY_STRING} ^s=bla$
RewriteRule ^index.php$ www.domain.de/bla? [NC,R=301,L]
But when I want not to use the filename, I cannot achieve the redirect. I have tried this:
- Code: Select all
RewriteCond %{QUERY_STRING} ^s=bla$
RewriteRule ^/$ www.domain.de/bla? [NC,R=301,L]
and
- Code: Select all
RewriteCond %{QUERY_STRING} ^s=bla$
RewriteRule ^$ www.domain.de/bla? [NC,R=301,L]
Both attempts failed cause of redirect loops.
Has anyone a solution?
Wurstbrot