After some research, I found out the reason. This is a code that removes the PHP extension.
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
The problem is the first line, but when I delete it, the page will work, but the whole code won’t. I’m not sure if the code is fine, but the RewriteEngine seems to be a problem. Are there any solutions out there?
Final Code
php_value display_errors On
php_value mbstring.http_input auto
php_value date.timezone America/New_York
DirectoryIndex router.php
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
That’s a very helpful and short code! It works just amazing. Could I please ask where did you find this solution @TigerMANEK426?
I’m also looking for a non-www force and file blocking, that isn’t working for me either.