Jump to content

[help] ErrorDocument 404 not working...only for php pages (html is fine)


Recommended Posts

hello,

 

i really hope someone can help me here.

 

i have written a custom 404.php page and i have set up my htaccess file to redirect all non-existing pages to this 404 page like so:

 

ErrorDocument 404 /404.php

 

everthing is working fine, APART FROM when i try to access a non existing PHP file in the ROOT directory only. for example :

 

www. mydomain.co.uk/this_page_doesnt_exist.php

 

this does not display my 404 page.  IE just says 'this page cannot be displayed', FF is just blank, and Chrome is a bit more informative, it says 'this page is not available: Error 324 (net::ERR_EMPTY_RESPONSE): Unknown error.'

 

HOWEVER if the non-existing page is inside a SUB DIRECTORY, for example:

 

www. mydomain.co.uk/subdir/this_page_doesnt_exist.php

 

then this is fine and my 404 page is displayed ! (whether the sub directory exists or not !)

 

ALSO if the extension is HTML instead of php then this works too, for example:

 

www. mydomain.co.uk/this_page_doesnt_exist.html

 

then this is fine and my 404 page is displayed !

 

i am running php V5.2.6 and i am with FastHost so i dont have access to the server. phpinfo shows that the ServerAPI is CGI/FastCGI and if there is any more info you need i will gladly give it.

 

i have used Fiddler and Wireshark to debug the HTTP traffic, and both show that no response is returned from the server. This would explain the problem but why is this happeniing ?

 

i have trawled the net but found nothing relating to this. if you want to see the problem in action, please go to my web site, just replace 'mydomain' above with 'sabalex'.

 

i am almost sure this is a bug ? can anyone confirm this? or tell me if i am doing something wrong ?

 

very grateful for any help.

 

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.