[Zen Cart] Adding a redirect rule
[Zen Cart] Adding a redirect rule
Hi
would you know how i can add a rule to my htaccess to permanently redirect:
http://www.mysite.com/?abcd
to
http://www.mysite.com/?aid=abcd
Thanks
L.
would you know how i can add a rule to my htaccess to permanently redirect:
http://www.mysite.com/?abcd
to
http://www.mysite.com/?aid=abcd
Thanks
L.
Re: [Zen Cart] Adding a redirect rule
Code: Select all
RewriteCond %{QUERY_STRING} ^([a-z]*)$ [NC]
RewriteRule (.*) http://www.mysite.com/$1?aid=%1 [R=301,L]
This should work for any URL on your site ending with "?aid=abcd".
Re: [Zen Cart] Adding a redirect rule
You mean it should work with any url ending with "?abcd" as the idea is to redirect those urls to the other...
Re: [Zen Cart] Adding a redirect rule
Thanks very much!
Re: [Zen Cart] Adding a redirect rule
Just another question, would it work too for:
?abcd2
to
?aid=abcd2
I mean with letters and numbers?
?abcd2
to
?aid=abcd2
I mean with letters and numbers?
Re: [Zen Cart] Adding a redirect rule
It should be changed by the following way:
Code: Select all
RewriteCond %{QUERY_STRING} ^([a-z0-9]*)$ [NC]
RewriteRule (.*) http://www.mysite.com/$1?aid=%1 [R=301,L]
Re: [Zen Cart] Adding a redirect rule
The new rule you provide is also good for:
?abcd2
?abc2d
?a2bcd
I mean no matter the order letter number?
?abcd2
?abc2d
?a2bcd
I mean no matter the order letter number?
Re: [Zen Cart] Adding a redirect rule
Thanks a lot!