Custom 404


#1

I have set up a custom 404 on my websites using htaccess however when i try to request a php file which does not exist, i get a “No input file specified” message rather than my 404 page. This doesn’t seem to happen with any other file type.

I seem to remember a post on the knowledge base about this but i can’t find it on the wiki.

Can anyone help? Ta.


#2

The problem is that the request is handled by PHP before the web server checks if the file exists or not. You will have to force the web server to check the if the file exists. One uses the mod_rewrite module to do that. You can configure mod_rewrite to have a PHP script handle “not found” requests for other file types as well.

The directives appear in the Wiki without explanation at:
Creating custom error pages

:cool: [color=#6600CC]Atropos[/color] | openvein.org