Any way to have a "#" (lb symbol) in a URL ?

Any way to have a "#" (lb symbol) in a URL ?

am 21.09.2007 04:00:17 von mpm_three

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

Re: Any way to have a "#" (lb symbol) in a URL ?

am 21.09.2007 11:21:14 von sean dreilinger

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/

Re: Any way to have a "#" (lb symbol) in a URL ?

am 21.09.2007 21:32:30 von mpm_three

On Sep 21, 4:21 am, sean dreilinger 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.