Skip to content

Instantly share code, notes, and snippets.

@vjandrea
Last active January 27, 2016 16:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vjandrea/307f9d0148648a961a9f to your computer and use it in GitHub Desktop.
Save vjandrea/307f9d0148648a961a9f to your computer and use it in GitHub Desktop.
Laravel .htaccess that supports a static section published under /public/ [http://stackoverflow.com/questions/29217937/how-to-route-to-a-static-folder-in-laravel]
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment