Created
May 28, 2014 11:34
-
-
Save terryupton/b638ab6ad75723ba7ecd to your computer and use it in GitHub Desktop.
Remove .php extension in HTAccess
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ------------------------------------------------------------------------------ | |
# | Remove .php-extension from urls | | |
# ------------------------------------------------------------------------------ | |
#This removes php extension | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule ^([^\.]+)/$ $1.php [NC,L] | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{THE_REQUEST} ^GET\ /[^?\s]+\.php | |
RewriteRule (.*)\.php$ /$1/ [L,R=301] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment