I added this to my htaccess on my local mamp server:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ $1.php [L,QSA]
This makes URLs work without the .php extension and it works fine. However if I go on a page that does not exist I get the “Internal Server Error” not the 404 page not found one…
Any suggestions?
That is because the rule match, conds 1 and 2 are all true. You need to stop the loop if the URL already contains .php so
This means match .* so long as the end anchor isn’t preceded by
.php