I have a working htaccess to remove the extension on some pages and its working. but the problem files in other folder like /blog/ dont work
i want also files in other folders to be removed
<code>RewriteEngine On
# Remove .php extension for specific pages
RewriteCond %{REQUEST_URI} ^/(index|contact)$ [NC]
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(index|contact)$ /$1.php [L]
# Redirect requests for .php files to extension-less URLs for specific pages
RewriteCond %{THE_REQUEST} s/(index|contact).php [NC]
RewriteRule ^(index|contact).php$ /$1 [L,R=301]
</code>
<code>RewriteEngine On
# Remove .php extension for specific pages
RewriteCond %{REQUEST_URI} ^/(index|contact)$ [NC]
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(index|contact)$ /$1.php [L]
# Redirect requests for .php files to extension-less URLs for specific pages
RewriteCond %{THE_REQUEST} s/(index|contact).php [NC]
RewriteRule ^(index|contact).php$ /$1 [L,R=301]
</code>
RewriteEngine On
# Remove .php extension for specific pages
RewriteCond %{REQUEST_URI} ^/(index|contact)$ [NC]
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(index|contact)$ /$1.php [L]
# Redirect requests for .php files to extension-less URLs for specific pages
RewriteCond %{THE_REQUEST} s/(index|contact).php [NC]
RewriteRule ^(index|contact).php$ /$1 [L,R=301]