warmseal-roofing/htaccess
2025-05-14 16:05:44 +01:00

9 lines
311 B
Plaintext

RewriteEngine On
# 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 (explicit)
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_URI}.php -f
RewriteRule ^(.*)$ $1.php [L]