Hope someone can help. I want to remove the file extension (.php) from internal links, but of course I need to configure it in htaccess first.
I believe the correct code is
RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^\.]+)$ .php [NC,L]
However, when I add this code below/above the pre-existing code (forcing https), nothing happens, i.e. I still need to put the .php Enter the URL.
After adding the above code, the htaccess file will look like this:
RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^\.]+)$ .php [NC,L] RewriteCond %{SERVER_PORT} !=443 RewriteRule ^(.*)$ https://mysite/ [R=301,L]Any ideas why this doesn't work?
Thanks
I've been searching online but all posts say to just add the rewrite code to htaccess, unfortunately this doesn't work.
I don't think this code plays well with the existing code that forces https?
I think RewriteRule is too complex. I use the following for all my sites: