[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cobalt-users] How to stop rewrite URL on 404 error



I'm trying to write a custom 404 Not Found error page, with a PHP script
that will e-mail me with the URL the visitor was trying to reach. If I put
"ErrorDocument 404 /notfound.php" in the .htaccess file for the site, the
URL in the browser will rewrite to http://www.mysite.com/notfound.php
regardless of what I type in for a bogus page to generate a 404 error. In
the e-mail, the $HTTP_REFERER variable will return nothing (that's if I just
type a nonexistent URL in the browser), and the $REQUEST_URI variable will
return /notfound.php.

I think the way to do this is turn off the URL rewriting when the visitor
tries to go to a nonexistent page, but I'm not sure how to do it (although I
figured out how to turn off rewriting so when the vistor would go to
http://mysite.com it wouldn't add the "www", but that didn't help the 404
error rewrite). Can anyone shed some light on how to do this?

By the way, I want to do this for only one site on the server, not the
entire server.

~ Chris Calabrese