Mod_Rewrite Tips: Redirect Site root to subdirectory
Looking to redirect your site root to a subdirectory? Whatever the reason, this is easily achieved with the every useful mod_rewrite. I'll assume you know what you are doing to some degree and that your .htaccess file is in place and you know mod_rewrite is working as it should. Redirect Root to Sub Directory The basics here are pretty simple. Firstly, you have a negative condition (prefixed with !) that tells the web server to ignore all requests that are made to the subdirectory. Then we set up a simple redirect for all other requests (.*) to redirect to the subdirectory. RewriteCond %{REQUEST_URI} !subdir/ RewriteRule (.*)...