what is the use of "~" tilde in url? [closed]
Asked Answered
B

5

48
  1. what is the use of ~ tilde in URL?

  2. I am using cPanel, and have link including tilde, why is tilde there?

    When we buy server space but do not have dns or don't want to use it for development purposes,we use the like http://serverip/~foldername.

Bautista answered 6/6, 2011 at 13:8 Comment(0)
M
22

Actually tilde '~' represents home directory. When you place tilde in url, It will access from home directory

Mayle answered 6/6, 2011 at 13:13 Comment(1)
This is one possible configuration and a common one on (oldish) unix systems. But there's no standard that requires this to be true.Legerdemain
B
80

Well, a webserver is free to use any character after the leading URI part for whatever purpose it wants.

That being said, the use of ~ generally hearkens back to the early days of the web, when just about every web server ran on Unix. In the Unix world, systems supported multiple users, each with their own home directory. If you want to go to your own home directory, you cd ~. If you want to go to some other user like fred's home directory, that would be cd ~fred.

So when people started putting up web servers, they would generally let every user in the system have their own web space, which is accesible from the root of the webserver by using ~username.

For example, a very old website of mine (now defunct) provided by an old ISP (Telepath) was at http://www.telepath.com/~dennison/

Bambibambie answered 6/6, 2011 at 13:25 Comment(1)
Damn, you forgot mentioning the "public_html" dir. ~user/ content was generally served from /home/user/public_html/ directory... Good old days :)Ravel
M
22

Actually tilde '~' represents home directory. When you place tilde in url, It will access from home directory

Mayle answered 6/6, 2011 at 13:13 Comment(1)
This is one possible configuration and a common one on (oldish) unix systems. But there's no standard that requires this to be true.Legerdemain
S
9

Tilde isn't anything special in the URLs. It's just another character like a %20 character or a -.

Some web host companies use it to identify users by giving the users directories like /~(username)/

Strathspey answered 6/6, 2011 at 13:12 Comment(0)
P
4

A tilde in a URL usually is followed by a user name and indicates that the files below that URL come from that user's home directory.

Pinette answered 6/6, 2011 at 13:12 Comment(0)
Y
1

~ refers to your home directory. If it is in the URL it means that the cpanel is located relative to your home directory.

Yahiya answered 6/6, 2011 at 13:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.