"~" at the beginning of URL references

A

Andrew Connell

I can't find any documentation for the tilde (~) when it's found at the beginning of a string in a URL. Is that something that points back to the root of the site?
 
N

Nicholas Paldino [.NET/C# MVP]

Andrew,

The tilde character ("~") doesn't have any special meaning for URLs. It
is just another character which represents a part of the path.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

I can't find any documentation for the tilde (~) when it's found at the
beginning of a string in a URL. Is that something that points back to the
root of the site?
 
J

Jon Skeet [C# MVP]

Andrew Connell said:
I can't find any documentation for the tilde (~) when it's found at the
beginning of a string in a URL. Is that something that points back to
the root of the site?

It's generally used for the concept of a "home" directory for a user.
For instance, my website URL is http://www.pobox.com/~skeet (although
that really directs to the "real" URL elsewhere). It's historically a
Unix thing, where ~foo is used to get to the home directory for user
foo.

I don't believe there's anything in HTTP which says how it should be
handled, so it's more of a convention than anything else.
 
D

Daniel Bass

it does seem to be a standard naming convention for some web servers when specifying a username sub path...

www.web.com/~UserName

that's about it... it's just another pathname character.
I can't find any documentation for the tilde (~) when it's found at the beginning of a string in a URL. Is that something that points back to the root of the site?
 
M

mikeb

Andrew said:
I can't find any documentation for the tilde (~) when it's found at the
beginning of a string in a URL. Is that something that points back to
the root of the site?

Basically, yes.

This is an under documented feature of ASP.NET Web Form controls. It
gets resolved to the application root by most (maybe all) ASP.NET server
controls. The ResolveUrl() method is what does the work (I think).

Probably the best explanation I've found is here:


http://groups.google.com/[email protected]
 
M

Michael A. Covington

In UNIX, ~foo means "the home directory of user 'foo'."

In some web servers, ~foo is the public_html directory of user 'foo' -- same idea.

I can't find any documentation for the tilde (~) when it's found at the beginning of a string in a URL. Is that something that points back to the root of the site?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top