Skip to content

Instantly share code, notes, and snippets.

@ajaegers
Created July 15, 2015 07:30
Show Gist options
  • Save ajaegers/2169fc164a4a5a5e1697 to your computer and use it in GitHub Desktop.
Save ajaegers/2169fc164a4a5a5e1697 to your computer and use it in GitHub Desktop.
.htaccess Transparent redirect in subfolder
RewriteEngine On
RewriteRule ^$ public/ [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f # if file doesn't exists
RewriteCond %{REQUEST_FILENAME} !-d # if file doesn't exists
RewriteCond %{REQUEST_URI} !^/public # if url without '/public'
RewriteRule ^(.*)$ public/$1 [QSA,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment