ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  Custom Error Pages with PHP and Apache
Subject:   I can't get it to work!
Date:   2008-01-01 02:23:52
From:   dawmail333
I can't get it to work?
Here's the code that I use on the error page:

$loc = isset($_SERVER['REDIRECT_URL']) ? $_SERVER['REDIRECT_URL'] : FALSE;
$cod = isset($_SERVER['REDIRECT_STATUS']) ? $_SERVER['REDIRECT_STATUS'] : FALSE;
print($loc);
print(" ");
print($cod);

However, when the page is displayed, it shows the error code correctly, but it prints the url to the error page, not the page they were trying to go to.
This is my .htaccess:

ErrorDocument 404 /err404.php
ErrorDocument 403 /err403.php
ErrorDocument 500 /err500.php



(Linebreak intentional)
Can anyone tell me what is going wrong? Thanks in advance.


1 to 1 of 1
1 to 1 of 1