HTML URL

HTML Uniform Resource Locators

A Uniform Resource Locator (URL), which is commonly called a web address, is a reference to a web resource specifying its location on the computer network and a mechanism for restoring it. A URL is a special type of Uniform Resource Identifier (URI), although sometimes these two terms are used interchangeably. In the majority web browsers, the URL of a web page is displayed above the page in an address bar.

A URL can be composed of words or an Internet Protocol (IP) address. Generally, users enter the name as they are easier to remember than numbers.

The syntax of a full Web address is the following:

scheme://prefix.domain:port/path/filename

Explanation:

类目类目
schemeSpecifies the type of Internet service. http/https is the most common.
prefixSpecifies a domain prefix. www is the default for http.
domainSpecifies the name of the Internet domain.
portSpecifies the port number at the host. 80 is the default for http.
pathSpecifies a path at the server. If it is omitted, the resource will be located at the root directory.
filenameSpecifies the name of a resource or document.

In HTML, a URL can have a partial form which is often called a relative URL. To create a full URL, a browser fills in missing parts of the URL from the relevant parts of the URL of the current page.

The following table lists some common schemes:

SchemeUsed for
http (HyperText Transfer Protocol)Common web pages (non encrypted).
https (Secure HyperText Transfer Protocol)Secure web pages (encrypted).
ftp (File Transfer Protocol)Downloading or uploading files.
fileA file on your computer.

URL Encoding

URL Encoding

URLs can be transmitted over the Internet only using the ASCII character set. If a URL has characters outside the ASCII set, the URL must be converted.

Non-ASCII characters are replaced with a “%”, which is followed by hexadecimal digits.

URLs cannot contain spaces. URL encoding commonly replaces a space with %20, or a plus (+) sign.



请遵守《互联网环境法规》文明发言,欢迎讨论问题
扫码反馈

扫一扫,反馈当前页面

咨询反馈
扫码关注
返回顶部