|
Posted by Bert Melis on 10/12/05 18:28
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.
>
Navigation:
[Reply to this message]
|