From 02fdacefd7d15276e0daba7c53105fe8ff4901f5 Mon Sep 17 00:00:00 2001 From: Gary Date: Wed, 14 May 2025 16:05:44 +0100 Subject: [PATCH] updated --- htaccess | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/htaccess b/htaccess index 003fc63..6232e94 100644 --- a/htaccess +++ b/htaccess @@ -1,10 +1,9 @@ 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] RewriteRule ^ /%1 [L,R=301] -# Internally rewrite requests without .php to the actual .php file -RewriteCond %{REQUEST_FILENAME} !-d -RewriteCond %{REQUEST_FILENAME}\.php -f -RewriteRule ^(.+)$ $1.php [L] \ No newline at end of file +# Internally rewrite requests WITHOUT .php to the actual .php file (explicit) +RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_URI}.php -f +RewriteRule ^(.*)$ $1.php [L] \ No newline at end of file