Skip to content

Instantly share code, notes, and snippets.

@josephrexme
Created December 22, 2014 12:40
Show Gist options
  • Save josephrexme/8a40d508ba98be85c6fb to your computer and use it in GitHub Desktop.
Save josephrexme/8a40d508ba98be85c6fb to your computer and use it in GitHub Desktop.
htaccess for apache web servers using PHP frameworks like Laravel
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment