Any .htacess experts out there? Need help with 301 redirect PLEASE.

Associate
Joined
10 Feb 2003
Posts
620
Hi All, i need help with what i thought would be a simple 301 redirect.

I need to redirect this page:
http://www.example.co.uk/shop/shop.php?c1=Accessories

to:
http://www.example.co.uk/accessories.htm

Both urls are on the same domain. can anyone help?

I have tried:
RewriteCond %{QUERY_STRING} ^c1=Accessories$
RewriteRule ^shop.php$ http://www.example.co.uk/accessories.htm? [L,R=301]

and some other variations but it seems to have no effect at all? I am completely stuck.

p.s There is a non-www to www direction in the .htaccess file and that is working fine, so i dont think it has anything to do with the redirect being switched off.

Can anyone spot the problem?
 
This works for me:

Code:
RewriteEngine On
RewriteCond %{QUERY_STRING} ^c1=Accessories$
RewriteRule ^shop[COLOR="Yellow"][B]\[/B][/COLOR].php$ /accessories.htm? [L,R=301]
 
Last edited:
Thanks matey. I managed to get it to work with:

RewriteCond %{QUERY_STRING} ^c1=Accessories$
RewriteRule ^shop/shop.php$ /accessories.htm? [L,R=301]

i think the problem was the /shop/ level. appreciate the reply!
 
Back
Top Bottom