Is it valid and safe to use the parent directory double-dots inside an URL like in the following example:
http://example.com/path/../to/file.jpg
RFC3986 defines URIs.
It describes how paths are hierarchical, and how...
The path segments "." and "..", also known as dot-segments
... work in a similar way to filesystem paths.
It also describes rules for "relative resolution" in which .
and ..
may be removed.
Essentially, it is legal and does what you expect.
Yes it absolutely works.
Just notice that the URL will change so the dots won't be displayed inside it. Like if you do http://path/to/new/../file
the displayed URL will be http://path/to/file
var url = base_url + relative_path