Forum Moderators: phranque
www.xyz.com/example/blah/ should redirect to www.xyz.com/example/
I tried the following:
RedirectMatch 301 ^/example/.+$ [xyz.com...]
but site hangs when trying to access www.xyz.com/example/
Thank you in advance for your help!
Is /example/ a real folder on the site, or is there a rewrite to an internal file involved to serve content.
If the latter, make the content URL
www.example.com/exampl[b]e[/b] and it will not rematch the pattern. In any case, if you were to use RewriteRule and not RedirectMatch you can have a rule which will not loop.
All pages on my site are formatted as such: www.xyz.com/example/
I need to move:
www.xyz.com/example/1/
www.xyz.com/example/1/1/
www.xyz.com/example/2/
www.xyz.com/example/2/1/1/
ALL to www.xyz.com/example/
I'm pretty sure I have a rewrite that changes www.xyz.com/example to www.xyz.com/example/
Is there any way I can write a one line redirect to cover all of these situations?
Thank you!
RedirectMatch 301 ^/example/([^/]+/)+(.*)$ http://www.example.com/example/$2
Jim
That works great, but there is one more issue that it doesn't cover.
I would like to also cover the possibility that someone writes:
www.xyz.com/example/a
If they don't put the 3rd slash, the redirect doesn't work.
If it cover that possibility as well, then I would be covered.
Thanks!
RedirectMatch 301 ^/cow-livestock-mats/. http://www.examplecom/cow-livestock-mats/
Jim
[edited by: jdMorgan at 8:26 pm (utc) on Dec. 7, 2009]