January 23rd, 2005, 10:50 PM
Quick question, this is such a little problem but I need to get it working. I need PHP to send a browser to it's local 404 page, exactly the same way it would if a page didn't exist. Here's what I'm trying:
This page should send your browser to a 404 page located on your filesystem, however it isn't on the servers I'm using. A "location:" redirect works fine, however this doesn't. The most embarrasing part is that I pulled that code directly from the PHP site, and it still doesn't work.
header("HTTP/1.0 404 Not Found");
I'm reading this but most of it is going over my head:
What can I do with php to get the browser to show the local filesystem's 404 page?
January 23rd, 2005, 11:42 PM
Doesn't this only work if Apache is configured correctly through ErrorDocuments? I don't think that script can be used universally...
doesn't do anything in Firefox, but it does work in IE... Can it be that Firefox strips the headers or something?
header("HTTP/1.1 404 Not Found");
February 8th, 2005, 08:26 PM
February 15th, 2005, 12:18 AM
all that header command is doing is defining that the page you are sending doesnt exist, it is sending the 404 error.
if you want it to go to the actual 404 error page you have defined in the .htaccess you will have to either include it yourself and generate it as part of the page or redirect to it using :
header ('Locate http://domain/404error.html');
or what have you