Grab a redirected URL infomation, howto?

L

lihao0129

Hi, there:

I have a question about grabbing the URI information of a redirected
weblink. For example, in my Apache configuration file, I added:

ErrorDocument 404 /error.html

then if I enter a wrong URL like:

http://myweb.com/dir/non-exist.html

the httpd server will automatically redirect my request to
http://myweb.com/error.html...

Now I want to display some dynamic information in error.html, for
example, the original request URL:

http://myweb.com/dir/non-exist.html

In HTML::Mason, I tried adding:

$m->request_comp->source_file
# returns /comp/root/error.html
$r->uri()
# returns /error.html

which are not what I wanted..

Are there any functions in mod_perl or HTML::Mason or other APIs that
I can grab '/dir/non-exist.html' from within '/error.html'..

Thank you very much for your input and suggestions..

Best regards,
Hao
 
J

J. Gleixner

Hi, there:

I have a question about grabbing the URI information of a redirected
weblink. For example, in my Apache configuration file, I added:

ErrorDocument 404 /error.html

then if I enter a wrong URL like:

http://myweb.com/dir/non-exist.html

the httpd server will automatically redirect my request to
http://myweb.com/error.html...

Now I want to display some dynamic information in error.html, for
example, the original request URL:

http://myweb.com/dir/non-exist.html

In HTML::Mason, I tried adding:

$m->request_comp->source_file
# returns /comp/root/error.html
$r->uri()
# returns /error.html

which are not what I wanted..

Are there any functions in mod_perl or HTML::Mason or other APIs that
I can grab '/dir/non-exist.html' from within '/error.html'..

Thank you very much for your input and suggestions..

Best regards,
Hao
$r->parsed_uri->unparse.

See:
http://www.masonhq.com/docs/manual/Admin.html#error_reporting_and_exceptions
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top