|
Home > Archive > Apache Server configuration support > September 2007 > Any way to have a "#" (lb symbol) in a URL ?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Any way to have a "#" (lb symbol) in a URL ?
|
|
| mpm_three@yahoo.com 2007-09-21, 1:32 am |
| 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
| |
| sean dreilinger 2007-09-21, 7:36 am |
| 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/
| |
| mpm_three@yahoo.com 2007-09-21, 7:24 pm |
| On Sep 21, 4:21 am, sean dreilinger <sean-use...@durak.org> wrote:
> hi m:
>
> mpm_th...@yahoo.com wrote:
>
> 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.
>
>
> 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.
|
|
|
|
|