I need to redirect from:
http://example.com/folder
to http://example.com/newfolder
But leave:
http://example.com/folder/subfolder
Whe
I've tried other methods here with mixed success. I am no Apache expert by any means, but here is the simple one-liner that works every time for me. I just use RedirectMatch
instead of Redirect
and include a very simple RegEx to end the match at or just before the trailing slash, meaning that subdirectories should never qualify as a match.
RedirectMatch 301 ^/folder[/]?$ /newfolder