Skip to content

Instantly share code, notes, and snippets.

@kaning
Created February 4, 2013 17:55
Show Gist options
  • Save kaning/4708318 to your computer and use it in GitHub Desktop.
Save kaning/4708318 to your computer and use it in GitHub Desktop.
.htaccess file to route request to another folder from the root directory already configured in vhosts
RewriteEngine On
RewriteRule ^\.htaccess$ - [F]
RewriteCond %{REQUEST_URI} =""
RewriteRule ^.*$ /public/index.php [NC,L]
RewriteCond %{REQUEST_URI} !^/public/.*$
RewriteRule ^(.*)$ /public/$1
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^.*$ - [NC,L]
RewriteRule ^public/.*$ /public/index.php [NC,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment