Hi, I wanted to ask about this little problem, not sure if its due to the server config because my .htaccess works fine on cPanel sharedhost and on VestaCP vps.
My .htaccess contains
ErrorDocument 404 /index.php
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.+)$ $1.php [NC,QSA,L]
On cPanel and VestaCP, above code just redirects to the root of domain if i entered the domain, domain /index , domain /index.php , domain /non-existent , domain /non-existent.php , domain/ non-existent.etc
with HestiaCP, if i entered domain /index , domain /index.php , domain /non-existent , domain/ non-existent.etc it will redirect to the root of domain, BUT when i enter domain/non-existent .php it shows white page “File not found.”
“File not found” is being triggered by the .php extension if the file does not exist on the server. I wanted it to redirect to the intended 404 document, which is index.php.
How to fix this one? Thanks