Skip to content

Instantly share code, notes, and snippets.

@inwdragon
Created May 10, 2018 07:40
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 inwdragon/f8863a20c9b2a1002bc276cdaad90fa7 to your computer and use it in GitHub Desktop.
Save inwdragon/f8863a20c9b2a1002bc276cdaad90fa7 to your computer and use it in GitHub Desktop.
.htaccess
DirectoryIndex index.php
RewriteEngine on
# If it does not exist as a directory
RewriteCond %{REQUEST_FILENAME} !-d
# And if it does not exist as a file
RewriteCond %{REQUEST_FILENAME} !-f
# Then add .php to get the actual filename
RewriteRule ^(.*)/? index.php?url=$1 [L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment