I want to remove .php
file extentions and add custom error page through .htaccess
file.
Following is the complete code of my .htaccess
file:
RewriteEngine On
#Remove .php file extension
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*[^/])/?$ $1.php [L]
#Use error500.php file located in the root dir
ErrorDocument 500 /error500
The first part to remove extension works but second part does not work. It does not use the error500.php
file. I have tried adding both with and without .php extention.
Here's the error that I get in the apache error.log
Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
What I'm doing wrong?