This commit is contained in:
Gary 2025-05-14 16:05:44 +01:00
parent 673cbfb21c
commit 02fdacefd7

View File

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