In many filesystems ".." corresponds to parent directory. How is it with URLs? I saw some examples behaving according to this scheme, but is this a standard (RFC)?
With a directory, a parent directory is a directory containing the current directory. For example, in the MS-DOS path below, the "Windows" directory is the parent directory of the "System32" directory, and C:\ is the root directory.
.. (double-dot) is the parent of your current directory. ~ (tilde) is your home directory. / (slash) if it present at first character, it usually is called root directory.
In the MS-DOS or Windows command line, the current working directory is displayed as the prompt. For example, if the prompt was "C:\Windows\System32>" the "System32" directory is the current directory, "Windows" is the parent directory, and "C:\" is the drive (root directory).
Exactly the same.
http://www.mysite.com/dir1/dir2/dir3/index.html
a link to "../../me.jpg" should give you http://www.mysite.com/dir1/me.jpg
The cod red virus that went round a good number of years back attacked IIS sites because c:\inetpub.. was the document root and if you did a url such as /../../../../windows/cmd.exe%20dir it would execute it!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With