Many kinds of URLs are defined by the uniform resource locator specification. (see appendix a, “sources for further information, “for a pointer to the most recent version.) this section describes some of the more popular URLs and some situations to look out for when using them.
HTTP
HTTP URLs are by far the most common type of URLs because they point to other documents on the web. HTTP, which stands for hypertext transfer protocol, Is the protocol that world wide web servers use to communicate with web browsers.
HTTP URLs follow this basic RUL form:
http://www.example.com/home/foo/
if the URL ends in a slash, the last part of the URL is considered a directory name. the file that you get using a URL of this type is the default file for that directory as defined by the GHTTP server, usually a file called index, html,. If the web page you’re designing is the top-level file for al a directory’s files, calling it index. Html is a good idea. Putting such a file in place will also keep users from browsing the directory where the file is located.
You also can specify the filename directly in the URL. In this case, the file at the end of the URL is the one that is loaded, as in the following examples:
http://www.foo.com/home/foo/index.html
http://www.foo.com/home/foo/homepage.html
using HTTP URLs such as the following, where foo is a directory, is also usually acceptable:
http://www.foo.com/home/foo
in this case, because foo is a directory, this URL should have a slash at the end. Most web servers can figure out that this is a link to a directory and redirect to the appropriate file. Some older servers, however, might have difficulties solving this URL, so you should always identify directories and files explicitly and make sure that a default file is available if you’re indicating a directory.
HTTP
HTTP URLs are by far the most common type of URLs because they point to other documents on the web. HTTP, which stands for hypertext transfer protocol, Is the protocol that world wide web servers use to communicate with web browsers.
HTTP URLs follow this basic RUL form:
http://www.example.com/home/foo/
if the URL ends in a slash, the last part of the URL is considered a directory name. the file that you get using a URL of this type is the default file for that directory as defined by the GHTTP server, usually a file called index, html,. If the web page you’re designing is the top-level file for al a directory’s files, calling it index. Html is a good idea. Putting such a file in place will also keep users from browsing the directory where the file is located.
You also can specify the filename directly in the URL. In this case, the file at the end of the URL is the one that is loaded, as in the following examples:
http://www.foo.com/home/foo/index.html
http://www.foo.com/home/foo/homepage.html
using HTTP URLs such as the following, where foo is a directory, is also usually acceptable:
http://www.foo.com/home/foo
in this case, because foo is a directory, this URL should have a slash at the end. Most web servers can figure out that this is a link to a directory and redirect to the appropriate file. Some older servers, however, might have difficulties solving this URL, so you should always identify directories and files explicitly and make sure that a default file is available if you’re indicating a directory.
No comments:
Post a Comment