MGCJerry
10-31-2002, 08:46 PM
I'm working on some custom error pages I'm wanting to fully integrate into my phpnuke site, but I'm having a little problems.
I added the following in my htaccess file:
##
## Error Documents
##
ErrorDocument 400 /errordocs.php?e=400
ErrorDocument 401 /errordocs.php?e=401
ErrorDocument 403 /errordocs.php?e=403
ErrorDocument 404 /errordocs.php?e=404
The script works fine when the failed request is for a file in the document root. Example: http://localhost/nosuch.file displayes the error page correctly, but when a file in a directory like http://localhost/somedirectory/nosuch.file and my images, and CSS doesnt show up.
Here is my php code:
include("mainfile.php");
include("header.php");
if ($e == "400") {
$errortitle ="Bad Request";
$errormsg ="page text";
} elseif ($e == "401") {
$errortitle ="AUnauthorized!";
$errormsg ="page text";
} elseif ($e == "403") {
$errortitle ="Forbidden!";
$errormsg ="page text";
} elseif ($e == "404") {
$errortitle ="File Not found!";
$errormsg ="page text";
} else {
$errortitle ="An Error has Occurred";
$errormsg ="page text";
}
OpenTable();
echo "<center><font class=\"title\">$errortitle</font></center>";
CloseTable();
echo "<br>";
OpenTable();
echo "$errormsg";
CloseTable();
include("footer.php");
?>
Hopefully I made a little sense :)
Thanks in advance.
I added the following in my htaccess file:
##
## Error Documents
##
ErrorDocument 400 /errordocs.php?e=400
ErrorDocument 401 /errordocs.php?e=401
ErrorDocument 403 /errordocs.php?e=403
ErrorDocument 404 /errordocs.php?e=404
The script works fine when the failed request is for a file in the document root. Example: http://localhost/nosuch.file displayes the error page correctly, but when a file in a directory like http://localhost/somedirectory/nosuch.file and my images, and CSS doesnt show up.
Here is my php code:
include("mainfile.php");
include("header.php");
if ($e == "400") {
$errortitle ="Bad Request";
$errormsg ="page text";
} elseif ($e == "401") {
$errortitle ="AUnauthorized!";
$errormsg ="page text";
} elseif ($e == "403") {
$errortitle ="Forbidden!";
$errormsg ="page text";
} elseif ($e == "404") {
$errortitle ="File Not found!";
$errormsg ="page text";
} else {
$errortitle ="An Error has Occurred";
$errormsg ="page text";
}
OpenTable();
echo "<center><font class=\"title\">$errortitle</font></center>";
CloseTable();
echo "<br>";
OpenTable();
echo "$errormsg";
CloseTable();
include("footer.php");
?>
Hopefully I made a little sense :)
Thanks in advance.
