Skip to content

Instantly share code, notes, and snippets.

@shavidzet
Last active October 24, 2016 10:21
Show Gist options
  • Save shavidzet/f00f43a8054a13775ded6861eb07f90d to your computer and use it in GitHub Desktop.
Save shavidzet/f00f43a8054a13775ded6861eb07f90d to your computer and use it in GitHub Desktop.
Access website without public directory
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
RewriteCond %{REQUEST_URI} !(\.css|\.js|\.png|\.jpg|\.gif|robots\.txt)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^/public/
RewriteRule ^(css|js|images)/(.*)$ public/$1/$2 [L,NC]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment