Forum Moderators: phranque

Message Too Old, No Replies

htaccess help for newbie

I've searched but just can't get my head around...

         

Advenlo

12:06 pm on Jul 11, 2006 (gmt 0)

10+ Year Member



As a non technical webmaster I'm seeking some guidance. I've tried to research but just ended up wasting aspirin!

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.

jdMorgan

2:53 pm on Jul 11, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> please provide?

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]

Advenlo

3:56 pm on Jul 11, 2006 (gmt 0)

10+ Year Member



Many thanks I've been through so much reading material my head is spinning. Some structured recommendations are very welcome.