1

I am trying to fix a lot of errors in our old website regarding a 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?

MrWhite
  • 12,647
  • 4
  • 29
  • 41
Josh Pennington
  • 288
  • 1
  • 6
  • 21

2 Answers2

1

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

andol
  • 6,938
  • 29
  • 43
1

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

golemwashere
  • 734
  • 1
  • 10
  • 22
  • 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 08 '10 at 17:25