From 673cbfb21cf3dd3f84630098f432d1a038aa66f3 Mon Sep 17 00:00:00 2001 From: Gary Date: Wed, 14 May 2025 16:03:44 +0100 Subject: [PATCH] updated --- htaccess | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htaccess b/htaccess index 0238793..003fc63 100644 --- a/htaccess +++ b/htaccess @@ -1,6 +1,10 @@ RewriteEngine On -# Remove .php extension from URLs +# Redirect requests for .php files to the same URL without .php +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