How to setup the arbitrary page of 404 error for *.php file?
I tried to setup 404 error page for my PHP-scripts, but instead of the page I always get an error saying "No input file specified".
Since PHP interpreter works as FastCGI, the directive
ErrorDocument 404 /customerrorpage.html
will not work for files with the extensions: .php .php3 .phtml .php4
Solution to this problem is simple; add the following code to your .htaccess file:
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteRule ^.+\.php$ /customerrorpage.html