Re: PHP error page not redirecting
| From: | Chris Hewitt | Date: | Mon, 10 Feb 2003 11:22:45 +0000 |
| Subject: | Re: PHP error page not redirecting | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-135034@lists.php.net to get a copy of this message | ||
Nick Holden wrote:
I'm having a dispute with an ISP (surprise) about the non-functioning of a PHP error script. Currently, the error script is at http://www.touristguides.org.uk/error.php - a direct click on that link will redirect you, using: header("Location: http://www.touristguides.org.uk/index.php"); And sure enough, you end up at /index.php However, when I ask for /nosuchpage I get a blank window, and the following source is output: <html><body></body></html> And that's all. I've stripped down all the complicated stuff from the error page, and I can't understand why it will redirect fine if it's called directly, but not if it is functioning as an error page (the .htaccess has the necessary ErrorDocument directives in it). The ISP say "I believe the problem may lie in the fact a 404 status has already been sent so it nullifies the 302 redirect status. I suggest searching php.net for more details" - which, naturally, I have done, without enlightenment. But the script works nicely on another server, suggesting that it might be something to do with the Apache configuration. I'm rapidly getting out of my depth now, and would appreciate some guidance on where to turn next. Thanks, NickI'm not an expert at this either, but you could test whether the nosuchpage 404 is getting to your error.php by replacing the redirection with some ordinary html that will display a message to you. At least that way you will know whether its the location header that is the problem or not. HTH Chris