| 5:33 am on Jan 11, 2008 (gmt 0)|
It seems to show up for IE but not Firefox... hmmm...
| 5:57 am on Jan 11, 2008 (gmt 0)|
See if this thread helps ...
| 1:55 pm on Jan 11, 2008 (gmt 0)|
Well, I tried using the include as per the instructions in the thread you suggested but the 404 still doesn't show up in Firefox. I even tried it on a separate website that I have and it still isn't showing up. I think I might try just redirecting to an actual page that loads instead of throwing a 404. I'm still curious as to why it's not displaying in Firefox though... it seems rather odd. Thanks for the help.
| 6:56 pm on Jan 11, 2008 (gmt 0)|
Have you got liveheaders for firefox? If so then check what the response from the page you are calling is.
In apache you should have something like -
ErrorDocument 404 /some_dir/my_error_page.php
So that when you go to example.com/doesnt_exist/bla_bla.not
apache redirects that request through to /some_dir/my_error_page.php
You may find that if you have used the full address for the apache ErrorDocument then you will get a 302 status, as http//something (: removed so there isnt a link...is there any way to stop that?) will result in an external redirect and a 302 header, then it gets to that page and has a 404 header thrown at it. Would be very confusing.
So check the headers returned by your 404 page then it may be an apache set up issue, as the php looks fine.
| 7:39 pm on Jan 11, 2008 (gmt 0)|
Firefox has no built-in default 404 display, so if your PHP script sends no HTML output in addition to the 404 header, nothing will be displayed by the browser.
Internet Explorer on the other hand uses a default informative 404 page if there is no HTML content returned along with the 404 header.
Apache's 404 configuration only applies to plain old .html files that haven't been handled by a filter (e.g. PHP).
| 10:48 pm on Jan 11, 2008 (gmt 0)|
But you can use the Apache error_docs if you have an Alias setup or at least know the path to the resource. Set up an Alias [httpd.apache.org] to the error_docs directory and then you can use them on a 404 by calling a url_not_found function. Something along these lines ...
header('HTTP/1.x 404 Not Found');
include realpath($_SERVER['DOCUMENT_ROOT'] . '/../error_docs/not_found.html');
Don't forget to make the error_docs available to PHP parsing if there is a base directory restriction [php.net] in place.