Skip to content

Instantly share code, notes, and snippets.

@sleeyax
Last active February 19, 2019 21:50
Show Gist options
  • Save sleeyax/080b2f5cdf77a0fcf684549ece2fa246 to your computer and use it in GitHub Desktop.
Save sleeyax/080b2f5cdf77a0fcf684549ece2fa246 to your computer and use it in GitHub Desktop.
htaccess for MVC frameworks
RewriteEngine On
# Check if request doesn't point to actual dir, file or symlink
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
# http://localhost/foo/bar => http://localhost/index.php?request=foo/bar
RewriteRule ^(.+)$ index.php?request=$1 [QSA,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment