One of the most important things to grasp when working on the Web is the format for URLs. A URL is basically an address on the Web, identifying each document uniquely (for example, https://www.art-lesson-plans.com). Since URLs are so fundamental to the Web, we discuss them here in a little detail.
- The simple syntax for a URL is:
- host
- The host to connect to: www.oreilly.com or www.google.com. (While many web servers run on hosts beginning with www, the www prefix is just a convention.)
- path
- The document requested on that server. This is not the same as the filesystem path, as its root is defined by the server.
- Most URLs follow this simple syntax. A more generalized syntax, however, is:
scheme://host/path/extra-path-info?query-info
- scheme
- The protocol that connects to the site. For web sites, the scheme is http; for FTP, the scheme is ftp.
- extra-path-info and query-info
For optional information used by CGI programs, search CGI overview on the web.