…
This is a simple tool to parse a URL into the different components, SCHEME, HOST, PORT, USER, PASS, PATH, QUERY or FRAGMENT. It incorporates a technique for parsing URLs into parts.
Try these examples, enter the following URL:
https://www.example.com:90/anything/thispage.html?param1=value1&category=ccard&affiliate_code=yt023#here
https://foo:bar@w1.example.com:8080/very/long/path.html?p1=v1&p2=v2#more-details
A URL string is a structured string containing multiple meaningful components. When parsed, a URL object is returned containing properties for each of these components.
[protocol:][//host[:port]][path][?query][#fragment]
The query string portion of a dynamic URL contains the search parameters. It parses the string into variables with each parameter being a property.
This function is not meant to validate the given URL, it only breaks it up into the above listed parts.
| request ----------------------------------------------- | | path ------------------- | | | authorization | | domain -------------- | | directory ---- || file - | | query ---------------- | | | | | | | || | | | | https://username:password@www.subdomain.example.com:1234/folder/subfolder/index.html?search=products&sort=false#top | | | | | | | | | | | | | | | | | | username | | | | | | folder folder | | | value | value | protocol password | | | | port | | parameter parameter | | | | 1st-level-domain | file-extension fragment | | 2nd-level-domain filename | 3rd-level-domain 4th-level-domain
[{ins-quote}]
Breakdown of a URL contains the following properties:
Perfection is achieved not when there is nothing more to add, but rather when there is nothing more to take away.
Antoine de Saint-Exupery
…
…