Last active
May 10, 2023 00:22
-
-
Save andrewjcurrie/b4bd8525d57a85387504399962eae637 to your computer and use it in GitHub Desktop.
Remove PHP Extension
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
# HTACCESS for Apache | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_FILENAME}\.php -f | |
RewriteRule ^(.*)$ $1.php [NC,L] | |
# NGINX Configuration | |
server { | |
index index.php; | |
location ~ \.php$ { | |
if ($request_uri ~ ^/([^?]*)\.php($|\?)) { return 302 /$1?$args; } | |
try_files $uri =404; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment