Now for a Simpler Explanation...
.
and ..
are NOT equivalent!
./
and ../
are NOT equivalent!
.
and ./
ARE equivalent to
In all cases, .
and ./
are the same as
or "" or no path so not needed or used on the Web.
.
(dot) is a relic of old UNIX pathing systems and NOT used on the World Wide Web for creating paths! Why? Because the dot in paths is redundant and equivalent to "" or no path
or the current file directory you are in. The same result applies to using ./
. It is the same as "" or no path
. Both just reference the local directory your file is in ("./webpage.html" = "webpage.html").
What Path Should I Use?
- So NEVER use
.
or ./
as both paths are irrelevant!
- ALWAYS use
../
which is a RELATIVE PATH and says go up one folder.
- ALWAYS use
/
which is an ABSOLUTE PATH and says starts from the website root folder.
Want More Proof?
Check out the result for these image paths. Assume you are referencing these paths from an HTML web page stored in the root of the web site:
SUCCESSFUL PATHS ("../" and "/" paths work well on the Web)
<img src="../images/photo.jpg" />
<img src="/images/photo.jpg" />
REDUNDANT PATHS ("." not needed)
<img src="/images/./photo.jpg" />
...same as...
<img src="/images/photo.jpg" />
<img src="/images./photo.jpg" />
...same as...
<img src="/images/photo.jpg" />
FAILED PATHS ("." in paths that fail on the Web)
<img src="/images/.photo.jpg" />
<img src="./images/photo.jpg" />