Ruben Laguna’s blog

How to Redirect Your Root Web Directory to a Subfolder With .htaccess

If you tried (like me) to redirect your / (root) web directory to a subfolder (like /wp/) modifying .htaccess in this way:


<span class='line'>Redirect 301  /</span>

You probably found that it didn’t work. The browser will end up in an endless loop of redirections. Firefox will complain with this error message:

The page isn't redirecting properly

Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
This problem can sometimes be caused by disabling or refusing to accept cookies.
The right way to accomplish the root to subfolder redirection is the following:


<span class='line'>RedirectMatch permanent ^/$</span>

Hope it helps


Copyright © 2015 - Ruben Laguna - Powered by Octopress