This is a discussion on Any way to have a "#" (lb symbol) in a URL ? within the Apache Web Server forums, part of the Web Server and Related Forums category; Hi, I want (if possible) to have a url like "http://mysite/##debug" which takes me to a ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi,
I want (if possible) to have a url like "http://mysite/##debug" which takes me to a html page. I've tried things like: Alias /\#\#debug "c:/debug/debug.html" AliasMatch ^/(.*)debug "c:/debug/debug.html" AliasMatch works for things like "http://mysite/123debug" but I guess "#s" (lb) are too embedded as being comments. So now I'm looking at the Rewrite mod just for httpd.conf but getting no where with this. The RewriteRule Directive has the ability to escape special chars but does this include "#s" (lbs)? Could it be the browser isn't even passing along anything past a # (lb)? Any help is appreciated, -m |
|
|||
|
hi m:
mpm_three@yahoo.com wrote: > I want (if possible) to have a url like "http://mysite/##debug" which > takes me to a html page. I've tried things like: there should not be any web browsers that accept what you're proposing -- the # hash or pound sign is a reserved character in URIs, its set aside as a fragment identifier, explained here in the URI spec: http://tools.ietf.org/html/rfc2396#section-4.1 ^ the way your browser knows to jump directly down to the correct subsection of this long boring RFC is because of the "section-4.1" fragment identifier, which is set apart from the rest of the URI via the # crosshatch / pound / hash symbol. i don't think your browser bothers to send anything after the '#' symbol to the remote server (i didn't tail a logfile to check, but that's what i suspect you'll find). here's the relevant excerpt from the RFC: The optional fragment identifier, separated from the URI by a crosshatch ("#") character, consists of additional reference information to be interpreted by the user agent after the retrieval action has been successfully completed. As such, it is not part of a URI, but is often used in conjunction with a URI. > So now I'm looking at the Rewrite mod just for httpd.conf but getting > no where with this. The RewriteRule Directive has the ability to > escape special chars but does this include "#s" (lbs)? if you want to use apache Redirect or mod_rewrite RewriteRule to _send_ visitors to a specific fragment of a URL, _that_ is supported nicely. both of these worked fine when i tried them on a machine running apache 2.2.6 via an .htaccess file, didn't even need to backslash-escape the #. Redirect /hash1 /lb1#fragment1 RewriteRule ^hash2 /lb2#fragment2 [redirect=permanent,last,noescape] hth --sean -- sean dreilinger - http://durak.org/sean/ |
|
|||
|
On Sep 21, 4:21 am, sean dreilinger <sean-use...@durak.org> wrote:
> hi m: > > mpm_th...@yahoo.com wrote: > > I want (if possible) to have a url like "http://mysite/##debug" which > > takes me to a html page. I've tried things like: > > there should not be any web browsers that accept what you're proposing -- the # > hash or pound sign is a reserved character in URIs, its set aside as a fragment > identifier, explained here in the URI spec: > > http://tools.ietf.org/html/rfc2396#section-4.1 > > ^ the way your browser knows to jump directly down to the correct subsection of > this long boring RFC is because of the "section-4.1" fragment identifier, which > is set apart from the rest of the URI via the # crosshatch / pound / hash > symbol. i don't think your browser bothers to send anything after the '#' symbol > to the remote server (i didn't tail a logfile to check, but that's what i > suspect you'll find). here's the relevant excerpt from the RFC: > > The optional fragment identifier, separated from > the URI by a crosshatch ("#") character, consists of additional > reference information to be interpreted by the user agent after the > retrieval action has been successfully completed. As such, it is not > part of a URI, but is often used in conjunction with a URI. > > > So now I'm looking at the Rewrite mod just for httpd.conf but getting > > no where with this. The RewriteRule Directive has the ability to > > escape special chars but does this include "#s" (lbs)? > > if you want to use apache Redirect or mod_rewrite RewriteRule to _send_ visitors > to a specific fragment of a URL, _that_ is supported nicely. both of these > worked fine when i tried them on a machine running apache 2.2.6 via an .htaccess > file, didn't even need to backslash-escape the #. > > Redirect /hash1 /lb1#fragment1 > RewriteRule ^hash2 /lb2#fragment2 [redirect=permanent,last,noescape] > > hth > > --sean > > -- > sean dreilinger -http://durak.org/sean/ That helps a lot. Thank you very much. |
| Thread Tools | |
| Display Modes | |
|
|