I have several URLs that I need to redirect to new locations, but there are situations where child pages should remain active and not redirect. For instance:
/products will be redirected to http://www.newsite.com/products
/products/category1 will be redirected to http://www.newsite/products/category1
But /products/specialitem will not be redirected at all.
Is this possible with Redirect or RedirectMatch?
Running Redirect 301 /products http://www.newsite.com/products seems to affect all child pages
Thanks for any guidance!
Edit:
Using the answernethec answer, I was able to start. But can anyone explain why my first rule below works, while others do not?
RedirectMatch 301 ^segment-one$ http://www.google.com/
RedirectMatch 301 ^segment-one/segment-two$ http://news.google.com/
RedirectMatch 301 ^segment-one/segment-two/segment-three$ http://cnn.com/
RedirectMatch 301 ^segment-one/segment-two/segment-three/foobar$ http://gbv.com/
(Without working, I mean that I can still get to the pages, and not redirect them.)
source share