URL详解
来源:互联网 发布:河南理工大学网络认证 编辑:程序博客网 时间:2024/06/08 04:20
非常非常好的一篇文章:
http://www.webdevelopersnotes.com/basics/urls.php3
URL stands for Uniform Resource Locator, which means it is a uniform (same throughout the world) way tolocate aresource (file or document) on the Internet. The URL specifies the address of a file and every file on the Internet has a unique address. Web software, such as your browser, use the URL to retrieve a file from the computer on which it resides.
The actual URL is a set of four numbers separated by periods(其实就是IP地址). An example of this would be 202.147.23.8 but as these are difficult for humans to use, addresses are represented in alphanumeric form that is more descriptive and easy to remember. Thus, the URL of my site which is URL 209.164.80.192 can also be written as www.simplygraphix.com. The InternetDomain Name System (就是DNS服务器) translates the alphanumerical address to numeric.
Format of a URL:
Protocol://site address/path/filename
For example, the URL of my company site is:
http://www.simplygraphix.com/
and a typical page on this site would be:
http://www.simplygraphix.com/portfolio/4.html
The above URL consist of:
- Protocol: http
- Host computer name: www
- Domain name: simplygraphix
- Domain type: com
- Path: /portfolio
- File name 4.html
Protocols
In addition to the http protocol (mentioned above), there are a few other protocols on the Internet.
- File: Enables a hyperlink to access a file on a local system. 这个也很常见啊~
- FTP: Used to download files from remote machines.
- Gopher: Helps in accessing a gopher server.
- mailto: Calls SMTP (the Simple Mail Transport Protocol) and enables a hyperlink to send an addressed email message.
- news: helps in accessing a USENET newsgroup.
- telnet: Provides the means for a hyperlink to open a telnet session on a remote computer.
Site Address
The site address consists of the host computer name, the domain name and the domain type. The domain name should be descriptive for easy comprehension and is usually the name of the organization or company.
There are various domain types. Some of them are listed below:
com: specifies commercial entities
net: highlights networks or network providers
org: organizations (usually non-profit)
edu: colleges and universities (education providers)
gov: government agencies
mil: military entities of the United States of America
For countries other than the U.S.A., the URL can be longer as in:
http://www.bioinfo.ernet.in
The general format of such URLs is:
machine name.domain name.domain type.country code.
Domain types can also be different for different countries. For example, an educational site can have the domain name www.school.ac.uk in the United Kingdom. Thusac (academic) is used instead ofedu. Similarlycom is represented as co for Indian domain names.
Path Name
Path name specifies the hierarchic location of the said file on the computer. For instance, in http://www.simplygraphix.com/portfolio/4.html the file4.html is located inportfolio subdirectory under the server root directory.
Port
Browsers communicate with the server using entry points called ports. Associated with each protocol is a default port number, such as HTTP defaults to port 80.
The server administrator can configure the server to handle http requests at a different port. In such cases, the port number has to be supplied as a part of the URL. The port number is placed at the end of the URL after a colon.
www.some-address.com:50
HTML Anchors
With HTML you can specify anchors within files. These anchors are end points to hyperlinks placed either in the same file or some other files.Anchors are placed to link to specific locations in a file. They can be a part of the URL and are represented with a hash symbol (#) followed by the link name.
www.some-address.com/some-file.html#some-location
所以有时不需要得到请求的整个file,只需要根据偏移量得到其中需要的一部分就行了。
- URL详解
- URL详解
- URL详解
- URL详解
- URL详解
- URL详解
- URL详解
- URL详解
- URL详解与URL编码
- actionscript 打开URL详解
- URL Rewrite 的详解
- PHP URL函数详解
- Domino URL Command 详解
- struts2 url标签详解
- google的url详解
- URL编码详解
- java之URL详解
- 详解URL的组成
- Lotus Workflow 安装要点
- IPC--共享内存 Share Memory 实例(shmget shmat shmdt shmctl)
- Hibernate分页查询原理解读
- 如何向 setTimeout 、 setInterval 传递参数
- JAVA终止线程
- URL详解
- inno setup介绍
- 我的问题
- python流言专用
- 测试流言专用
- wince隐藏任务栏与桌面图标
- linux留言专用
- 深入理解指针函数
- 去掉opencms的2个opencms