perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Ho <and...@tellme.com>
Subject Re: Redirect with anchors.
Date Mon, 09 Apr 2001 02:25:28 GMT
Hello,

AL>$req_rec->header_out("Location" => "intranet.html?action=show#anchor_name");

EM>I think you should provide the _complete_ URL, including the
EM>http://server part.  Some browser do not handle incomplete URL's like
EM>this in a redirect correctly.  Please someone correct me if I'm wrong
EM>here...

Actually, there was a long thread on this a while back on this mailing
list. Apache will intercept any URL without http:// and tack on the right
hostname. You can verify this by doing the above code and telnetting to
port 80 manually. So it doesn't matter whether you add the hostname or not
(although I like to, because I like to rely as little as possible on magic
API behavior).

EM>Some browsers support the ?action#anchor syntax.  Some don't
EM>(particularly not too recent MSIE's).  If you really want to reliably do
EM>this, you should hide your parameter in the URL and use a RewriteRule or
EM>a mod_perl handler to extract the parameter, e.g. instead of
EM>"intranet.html?action=show#anchor_name" use a URL in the form
EM>"/show/intranet.html#anchor".

Actually, the syntax ?foo=bar#anchor is correct according to the URI
specification--the anchor always goes last. My version of MSIE barfs on
this, but Netscape picks it up correctly. The moral is, that this is a
very badly understood and poorly implemented form of a URI, so your advice
on hiding either the query arguments or the anchor is exactly correct.

Humbly,

Andrew

----------------------------------------------------------------------
Andrew Ho               http://www.tellme.com/       andrew@tellme.com
Engineer                   info@tellme.com          Voice 650-930-9062
Tellme Networks, Inc.       1-800-555-TELL            Fax 650-930-9101
----------------------------------------------------------------------


Mime
View raw message