I have a site where I'm trying to 301 all the root traffic to a folder. I've tried, RewriteEngine On RewriteBase / RewriteRule (.*)$ http://www.domain.com/forums/$1 [R=301,L] Code (markup): But this end up redirecting to, http://www.domain.com/forums/forums/forums/forums/forums/forums/ etc etc etc Anyone solved this before?
Yes, Remove the index.html file in your root and make a index.php containing this: <?php header("location:/forum/"); ?> Code (markup): 3 Hope this helped you out!
You might be able to use this; <meta http-equiv="Refresh" content="0; url=/forum/"> Code (markup): 0 is the number of seconds you want it to load after it redirects to your forum... Let me know if this worked...
Id' rather use a 301 redirect than a meta refresh, it can cause problems with SEO. I appreciate your help though It's frustrating as I have seen this done before with a 301, I just can't for the life of me remember how it was done!
The easy solution is to turn RewriteEngine off in the sub-directory, but that's usually not an option. This may work for you though, or at least be close. RewriteCond %{REQUEST_URI} !^/?forum RewriteRule ^(.+)?$ http://domain.com/forum/$1 [QSA,R=301] Code (markup):
I managed to find a solution, RedirectMatch permanent ^/$ http://mydomain.com/php/index.php Code (markup): This worked fine