I have seen so many posts about this so apologies for yet another. I have tried to read around how this works with little success: To start with here is my .htaccess
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(([^/]+/)*[^.]+)$ /$1.php [L]
The first sets http to https - it works so .htaccess active. The second is meant to remove the .php from the url - it doesn't.
My main question is how to remove .php from each URL. My second rewrite rule is meant to do this but it doesn't. Yes, it is copied from a previous question but I would really like to understand exactly what the syntax means so that I can understand why it is not working.
So my questions are:
- Can anyone point me to a decent explanation of the syntax for
RewriteCondandRewriteRule? I have looked a number of docs including the Apache http://httpd.apache.org/docs/current/rewrite/ docs but I am no better off. - And / or why does the .php removal not work?
A cheeky extra simple question ... do I need to repeat RewriteEngine On or do I just need it once?