question about # character

Topics: User Forum
Coordinator
Sep 18, 2006 at 6:33 PM
A user writes:

Thanks for providing such a useful URL rewrite utility free of charge. I had
one question though: is the "#" character in the URL ignored or stripped out
before the request is sent to the server? I am trying to rewrite a URL like
"http://localhost/#page1" to "http://localhost/subdir/page1" but it doesn't seem
to work. Any insight you might be able to provide would be vastly appreciated.

Many thanks,
Coordinator
Sep 18, 2006 at 6:39 PM
The # character is not part of the URL request sent to the server. This character precedes the name of an anchor in the HTML document. It is used as an instruction to the browser to scroll to the named anchor, if and when the page returns with an anchor of that name. The URL request sent to the server does not include the character or the anchor name, and the server logic is never made aware of this character, or the browser's plan to scroll to the named anchor when it can do so.

as a result, you cannot do server-side rewrites of URLs based on the named anchor in a request. the # and anchor name never get to the server.

does this help?

-Dino
Sep 18, 2006 at 7:44 PM
Hi Dino,

Thanks for your response. That answers my question perfectly.

.Tai