3 ms·
Slashes are not special in URLs (unlike #, & and semicolon). It's only servers that parse them as path separators.
by bonzini 6y ago
Slashes are not special in URLs (unlike #, & and semicolon). It's only servers that parse them as path separators.
- zokier 6y agoSee section 3.3 "Path" in RFC 3986: https://tools.ietf.org/html/rfc3986#section-3.3 https://tools.ietf.org/html/rfc3986#section-3.3 > A path consists of a sequence of path segments separated by a slash ("/") character
- TazeTSchnitzel 6y agoRFC 3986 says one thing, but what the HTTP protocol allows servers to do and they actually implement is another thing.
- zokier 6y agoHTTP protocol RFC pretty explicitly says that the Request-URI transmitted is a "path" and refers to URI RFC to define "path". There is really no ambiguity here, HTTP as a protocol expects resources to be organized as an hierarchy and accessed via a path, which is delimited by "/" characters. As such the protocol definitely reserves and assigns special meaning to "/" in paths. Of course servers are perfectly free to do whatever they want, there is no HTTP police to stop them.
- bonzini 6y agoIt continues like this: "Use of the slash character to indicate hierarchy is only required when a URI will be used as the context for relative references [...] The path segments "." and ".." [...] 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. [...] Aside from dot-segments in hierarchical paths, a path segment is considered opaque by the generic syntax." As long as Wikipedia doesn't use relative paths it is not a problem to have slashes in the URL.