[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.


I don't know how you have your RAQ configured, but I have a file called 404err.shtml as my 404 documents (defined in .htaccess, as you suggest) - and this page calls a referrer recording CGI script - it's a snip - nothing to it.

I read:

REDIRECT_REDIRECT_SCRIPT_URI=http://www.webyourbusiness.com/asdadadasdasd
REDIRECT_REDIRECT_SCRIPT_URL=/asdadadasdasd
REDIRECT_REDIRECT_URL=/asdadadasdasd
REDIRECT_REQUEST_URI=/asdadadasdasd
REDIRECT_SCRIPT_URI=http://www.webyourbusiness.com/asdadadasdasd
REDIRECT_SCRIPT_URL=/asdadadasdasd
REDIRECT_SERVER_ADMIN=admin
REQUEST_URI=/asdadadasdasd
SCRIPT_URI=http://www.webyourbusiness.com/asdadadasdasd
SCRIPT_URL=/asdadadasdasd


By placing a call to env in the .shtml file, I saw all of the above environments variables with my fictitious URL in it - take your pick.

Greg
--

By placing these in an ssi echo, all I get is this...

REDIRECT_REDIRECT_SCRIPT_URI: (none)
REDIRECT_REDIRECT_SCRIPT_URL: (none)
REDIRECT_REDIRECT_URL: (none)
REDIRECT_REQUEST_URI: (none)
REDIRECT_SCRIPT_URI: (none)
REDIRECT_SCRIPT_URL: (none)
REDIRECT_SERVER_ADMIN: (none)
REQUEST_URI: /pagenotfound.shtml
SCRIPT_URI: http://www.pdcweb.net/pagenotfound.shtml
SCRIPT_URL: /pagenotfound.shtml

URL was http://www.pdcweb.net/foobar.html

I'd really like to see the HTTP_REFERER.

- Bill




------------------------------------
William J.A. Brillinger
Precision Design Co./Promotex Online

E-Mail:   billy@xxxxxxxxxx
Web site: www.pdcweb.net