Ruben Laguna's blog

Sep 6, 2007 - 1 minute read - Comments - http linux redirect redirectmatch root subfolder web

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:

Redirect 301 / http://rubenlaguna.com/wp/

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:

RedirectMatch permanent ^/$ http://rubenlaguna.com/wp/

Hope it helps