Home > Archive > Unix Programming > May 2004 > ErrorDocument question
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
ErrorDocument question
|
|
|
| I am not a Unix server admin, just a user on a shared system, and I'm not
sure of the best group to ask this question, but I would like to edit my
..htaccess 404 redirect so that it captures the pathname of the URL (i.e.
for http://www.example.com/pathname.html I would want to capture the
'pathname.html' portion of the URI). I am thinking I could pass it on this
way: http;//www.mysite.com/404.html?pathname.html
Is there a way I can capture all or part of the requested URL in a variable
I can then tack onto the ErrorDocument string in the .htaccess file?
Thanks for any help!
Derf
| |
| Ian Wilson 2004-05-18, 6:31 am |
| Derf wrote:
> I am not a Unix server admin, just a user on a shared system, and I'm not
> sure of the best group to ask this question, but I would like to edit my
> .htaccess 404 redirect so that it captures the pathname of the URL (i.e.
> for http://www.example.com/pathname.html I would want to capture the
> 'pathname.html' portion of the URI). I am thinking I could pass it on this
> way: http;//www.mysite.com/404.html?pathname.html
>
> Is there a way I can capture all or part of the requested URL in a variable
> I can then tack onto the ErrorDocument string in the .htaccess file?
>
You don't mention the web server but since you say Unix I'll assume
Apache. It would be useful to know the version.
Any request for a nonexistent page will normally be logged in the Apache
error log. Many hosting copmanies provide their customers with access to
the error log - check your hosting control-panel.
If you dont have access to the error log but do have access to CGI or
PHP then you can write a custom error handler to deal with 404 "document
not found" errors.
http://httpd.apache.org/docs-2.0/mo...l#errordocument
| |
|
|
|
|
|