Resolve a relative URL and preserve repeated parameters
Admin ·
Compare two base URLs that differ by one slash. Then edit a repeated query parameter and see exactly how a literal plus sign appears in the finished URL.
Base URL (optional)
The final slash in the base URL changes the result. A base ending in /docs/ names a directory. A base ending in /docs names a file-like path whose last segment the browser replaces. Try the same relative input with both bases below. With base https://example.org/catalog/items/ and relative input ../sale?size=M#stock, the result has path /catalog/sale, query size=M and fragment stock. Change the base to /catalog/items without its final slash and the path resolves to /sale.
| Base URL (optional) | URL or path | Result |
|---|---|---|
| https://example.org/docs/ | p?tag=red&tag=blue#top | https://example.org/docs/p?tag=red&tag=blue#top |
| https://example.org/docs | p?tag=red&tag=blue#top | https://example.org/p?tag=red&tag=blue#top |
Query string
Change only the second tag value to C++. In the output, each literal plus becomes %2B. The first tag and the fragment stay intact. If the result surprises you, inspect the base and path fields before editing any query values. Parsing a URL identifies these components locally. It provides no evidence that the destination exists.
| URL or path | Result |
|---|---|
| https://example.org/docs/p?tag=red&tag=blue#top | https://example.org/docs/p?tag=red&tag=C%2B%2B#top |
Common questions
What happens to repeated keys?
Both rows are preserved in their original order.
Does parsing visit the address?
The browser reads the address as text on this device.
Sources and further reading
Put it into practice.
Related guides
- How to URL Encode and Decode Text
- How to Encode and Decode Base64 Text (UTF-8)
- Auditing slugs in a saved list of URLs
- Checking shortcodes against a local inventory
- Resolve a URI and Check its IANA Scheme
- Check a Domain Suffix in the IANA Root List
- Trace Duplicate ads.txt Entries
- Check an App Seller File and Its Host
- Trace Repeated Backlink Anchors in a CSV