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

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



> At 10:29 PM 24/09/01 -0600, you wrote:
> > >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.
> - Bill

You probably need to use a global reference to the HTTP environment
variables in your subroutine
example.

global $HTTP_USER_AGENT,$REMOTE_ADDR,$REQUEST_URI;

We use a 404.php and spider.php script that redirects the file not found to
enhance all our clients search engine standing.

404 details
http://www.site-etc.com/html/etc-404.html

404 file not found example
http://www.site-etc.com/fielnotfound.test

Sim