Page 1 of 1

Error Page Handling with Apache

Posted: Wed May 25, 2005 6:20 pm
by Skara
Don't know if this would go here or in the Apache forum.
In any case, here's the deal. I'd basically like to add a line like this:

ErrorDocument 404 /error/all.php?code=404

Now the only way I can think of to do something like this is to do it the opposite way. Have a top and bottom file and include those from the 404.php page.
If I have to do this, so be it, but I was hoping there'd be a better way to pass a variable somehow. Ideas?

Posted: Thu May 26, 2005 6:24 am
by artexercise
can you pass an error inside form tags and use <input type="hidden" name="errorCode" Value="404">? And then check _POST in the subsequenet page?

JOE--

Posted: Thu May 26, 2005 4:57 pm
by Skara
I don't really see what you mean. My question is how would I pass a variable to a file through httpd.conf.

Posted: Thu May 26, 2005 5:50 pm
by artexercise
oops I misunderstood.

httpd.conf

Code: Select all

ErrorDocument 404 /all.php
Somewhere at the beginning of all.php

Code: Select all

$server_error_type = $_SERVER&#1111;'REDIRECT_STATUS'];
This might work. Beyond this, I'd try your idea. :)

JOE--