My understanding of the general form of a URL is that it looks as follows:
<scheme>://<host><path>?<query>#<fragment>
Can there be any forward slashes in either the query or the fragment? More generally, are there any characters that are specifically reserved for any single part of a URL?
STD 66 defines the fragment as:
fragment = *( pchar / "/" / "?" )
So aside from characters from the pchar
set (unreserved / pct-encoded / sub-delims / ":" / "@"
), the /
and the ?
can be used in the fragment directly (i.e., percent-encoding is not needed).
The /
is even mentioned explicitly in the text:
The characters slash ("/") and question mark ("?") are allowed to represent data within the fragment identifier. Beware that some older, erroneous implementations may not handle this data correctly when it is used as the base URI for relative references (Section 5.1).
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