Re: anchors in Location: header

Randal Schwartz (merlyn@stonehenge.com)
05 Nov 1997 08:40:00 -0700


>>>>> "Bill" == Bill Houle <Bill.Houle@sandiegoca.ncr.com> writes:

Bill> My apologies; this not a question specific to LWP problems. But
Bill> I've asked a few CGI lists and cannot find an answer.

You're right.  This has nothing to do with LWP.  Please don't be rude
like that the *next* time.  This list is strictly for *development* of
LWP, not support of same nor support of other web-ish stuff.

But since you've already burned your bridge before you got to it,
here's your answer...

Bill> The HTTP specs claim that only an absolute URI -- read "fully http:
Bill> qualified" -- can be used for a Location redirect. However, I have verified
Bill> that this works:

Bill> 	$url = "/path/to/file.htm";
Bill> 	print "Location: $url\n\n";

Bill> Yet this does not:
Bill> 	$url = "/path/to/file.htm";
Bill> 	$url .= "#anchor";
Bill> 	print "Location: $url\n\n";

Bill> If I fully-qualify the URL (http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT})
Bill> both examples work. 

Bill> Is my interpretation of the RFC incorrect, or is the fact that one works
Bill> and the other doesn't a browser (NN4.0) or server (NCSA1.5) anomaly? Is
Bill> there any way I can get an anchored, absolute, non-qualifed URI to work
Bill> universally in a Location: field?

It's not anomaly.  An internal redirect (one beginning with /) is
handled entirely within the server.  As such, there's no way to tell
the browser to scroll to #symbol once the page is delivered.  An
external redirect (one beginning with a protocol) is sent as-is to the
browser, and now the browser has access to the scroll-anchor.

Live with it.

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me