-
-
Save brendonexus/129a6a2310fcaee94c41d7d20970a313 to your computer and use it in GitHub Desktop.
No more .php extensions
This file contains 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
RewriteEngine on | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_FILENAME}\.php -f | |
RewriteRule ^(.*)$ $1.php | |
# Return 404 if original request is .php | |
RewriteCond %{THE_REQUEST} "^[^ ]* .*?\.php[? ].*$" | |
RewriteRule .* - [L,R=404] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment