Forum Moderators: phranque
I have inherited a website with many products. Each product has many pages, differentiated in their urls by mydomain.com/product=1, product=2 etc.
The pages are largely similar and I wish to redirect all the =2, =3 pages to mydomain.com/product=1. As there are thousands of products, is there a simple way of using .htaccess to do this. If so could someone with a larger brain than me please provide?
Many thanks in advance.
In line with our forum charter [webmasterworld.com], we can help you find a solution or discuss specific questions and drop a few hints to get you started:
You're looking for Apache mod_rewrite [httpd.apache.org], using the RewriteCond directive to examine the %{QUERY_STRING} variable, and replace any occurrance of "product=[2-9]" with "product=1" in the RewriteRule substitution URL.
The above will make more sense if you refer to the cited documentation.
And for additional information, see the documents cited in our forum charter [webmasterworld.com] and the tutorials in the Apache forum section of the WebmasterWorld library [webmasterworld.com].
Jim
[edited by: jdMorgan at 1:40 am (utc) on July 12, 2006]