This commit is contained in:
Gary 2025-05-14 16:07:51 +01:00
parent 02fdacefd7
commit 23a3f79d30

View File

@ -1,9 +1,6 @@
RewriteEngine On RewriteEngine On
# Redirect requests for .php files (as before) # Remove .php extension from URLs
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^.]+)\.php [NC] RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ /%1 [L,R=301] RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.+)$ $1.php [L]
# Internally rewrite requests WITHOUT .php to the actual .php file (explicit)
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_URI}.php -f
RewriteRule ^(.*)$ $1.php [L]