Forum Moderators: phranque
I have the following problem:
URL old:
http://www.mydomain.de/index.php?s=2&Search_Brand=BRAND
URL new:
http://www.mydomain.de/brand
I made Conds and Rules – these are working just fine, e.g.:
RewriteCond %{QUERY_STRING} ^s=2&Search_Brand=BRAND$
RewriteRule ^(.*)$ /brand? [L,R=301]
These are special pages that have a new target URL. Besides those "important" ones the other URLs with /index.php?s=...., should all be redirected to the startpage.
So I want special rules for some URLs and the "rest" should be redirected to the startpage.
There is the rule I put at the end of all other rules:
RewriteRule ^index\.php$ http://www.mydomain.de/? [R=301,L]
It works just fine but now the special rules (see above) do not work anymore (even with [R=301,L]) and are also redirected to the startpage.
Anyone has a clue? I appreciate it.
I am not sure if I got it right:
RewriteCond %{QUERY_STRING} ^s=2&Search_Brand=BRAND$
RewriteRule ^(.*)$ http://www.mydomain.de/brand? [L,R=301]
but how do I check THE_REQUEST? Do I need to add another RewriteCond %{THE_REQUEST} - but what to put there?
I have checked the forum but could not find a solution for my particular problem.
RewriteCond %{THE_REQUEST} ^[A-Z]+\ /index\.php(#[^?&\ ]*)?\?([^&\ ]*&)?s=2&Search_Brand=([^&\ ]+)[^\ ]*\ HTTP/
RewriteRule ^index\.php http://www.example.com/%3? [R=301,L]
Jim