I am trying to fix a lot of errros in our old website regarding thing with product pages having multiple URLs associated with a single product.

I am hoping that I can use regular expressions in with a regular redirect 301 line but so far I cannot seem to get it to work.

Here is what I am trying:

redirect 301 /products/(.?)/(.?)/5702/(.*?).html http://mycompany.com/footwear/wolverine-boots-waterproof-durashocks-work-boots-2582-33390.html

Does anyone have any ideas as to what I am doing wrong?

Thanks much

Josh Pennington

link|improve this question

Just for clarification, we are talking about Apache, right? – andol Aug 8 '10 at 17:08
Yes I am using Apache – Josh Pennington Aug 8 '10 at 17:24
feedback

2 Answers

up vote 0 down vote accepted

The redirect directive doesn't take regular expressions. What you probably want to use instead is RedirectMatch.

link|improve this answer
feedback

you could use mod_rewrite

with something like:

RewriteEngine  on
RewriteRule ^/products/(.?)/(.?)/5702/(.*).html http://mycompany.com/footwear/wolverine-boots-waterproof-durashocks-work-boots-2582-33390.html [L,R=301]

can you give example of structure you are trying to redirect? es: /product/aa/bb/1234/aaaaaaaaaaa.html

link|improve this answer
the first regex block is in the format 23_45_67 (numbers with _ between them) and the second one is a regular int and the third block is a string. – Josh Pennington Aug 8 '10 at 17:25
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.