What does a dot mean in a URL path?

The path segment . is typically used at the begin of relative path references and are removed during the reference resolution, i.e. the process of resolving a relative URI reference to an absolute URI:

The path segments “.” and “..“, also known as dot-segments, are
defined for relative reference within the path name hierarchy. They
are intended for use at the beginning of a relative-path reference
(Section 4.2) to indicate relative position within the hierarchical
tree of names. This is similar to their role within some operating
systems’ file directory structures to indicate the current directory
and parent directory, respectively. However, unlike in a file
system, these dot-segments are only interpreted within the URI path
hierarchy and are removed as part of the resolution process (Section
5.2
).

There is Remove Dot Segments algorithms that describes how these dot segments are to be interpreted in a certain base path context.

In your case both ./delete-misc/test-ajax-code.php and delete-misc/test-ajax-code.php are equivalent. But there are cases where a relative path can be misinterpreted as an absolute URI, e.g. having a : in the first path segment like search:foo that is different to ./search:foo as the former is an absolute URI while the latter is a relative URI path.

Leave a Comment