Reputation: 975
I am trying to redirect an old directory, all possibly sub-directories, and all possible files all to one new directory.
Redirect anything such as:
and so on all should redirect to .com/new
I've tried several .htaccess generators and tutorials, and I get a very mixed baskets of results.
For example, the most common problem I get is that .com/old/older/index.php will redirect to .com/new/older/index.php instead of just .com/new.
Upvotes: 2
Views: 49
Reputation: 785256
You can use this simple 301 rule in your site root .htaccess:
RedirectMatch 301 ^/old(/.*)?$ /new
Or else use this rule in /old/.htaccess
file:
RedirectMatch 301 ^ /new
Upvotes: 2