Re: 'HTTP_REFERER'
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

Re: 'HTTP_REFERER'

From: Bert Melis <bert.melis@offsite_remove_this_.be>
Date: Wed Oct 12 2005 - 17:28:35 CEST

If you put the absolute path into your htaccess

ErrorDocument 404 http://www.domain.tld/errors/404.php

the address in the address-bar of your browser changes to the
error-document. If you put a relative document in your htaccess

ErrorDocument 404 /errors/404.php

the address will not change, and you can fetch the wrong url by
$_SERVER['REQUEST_URI'].

Philip Ronan wrote:
> "juglesh" wrote:
>
>
>>So, how can we make a 404 page that either shows the poblem URL in the
>>address bar, or can get the problem URL so I can display it in a text
>>box where the user can correct it and click a 'go' button? (I know how
>>to make that text box, but not how to get the problem URL).
>
>
> You need to add an ErrorDocument directive to your .htaccess file:
> <http://httpd.apache.org/docs/1.3/mod/core.html#errordocument>
>
> e.g.
> ErrorDocument 404 /error/my404.php
>
> In your script at /error/my404.php, you can get the name of the originally
> requested URI from $_SERVER['REQUEST_URI']
>
> Once you've done that, any requests for non-existent files in the hierarchy
> covered by your .htaccess file will be dealt with by your custom script.
>
Received on Tue Oct 18 02:40:43 2005