Home  >  Article  >  Web Front-end  >  URL - Uniform Resource Locator

URL - Uniform Resource Locator

WBOY
WBOYOriginal
2016-09-14 09:24:131458browse

URL - Uniform Resource Locator

URL can consist of words, such as “w3school.com.cn”, or an Internet Protocol (IP) address: 192.168.1.253. Most people type the domain name of a website when they surf the web because names are easier to remember than numbers.

Grammar rules:
scheme:<span style="color: #008000;">//</span><span style="color: #008000;">host.domain:port/path/filename</span>

Explanation:

  • scheme - Defines the type of Internet service. The most common type is http
  • host - Define the domain host (the default host for http is www)
  • domain - Define Internet domain name, such as w3school.com.cn
  • :port - Define the port number on the host (the default port number for http is 80)
  • path - defines the path on the server (if omitted, the document must be in the root of the website).
  • filename - defines the name of the document/resource

URL Schemes

Here are some of the most popular schemes:

Scheme Access for...
http Hypertext Transfer Protocol Ordinary web pages starting with http://. No encryption.
https Secure Hypertext Transfer Protocol Secure web page. Encrypt all information exchanged.
ftp File Transfer Protocol Used to download or upload files to the website.
file

URL encoding

URL encoding converts characters into a format that can be transmitted over the Internet.

URLs can only be sent over the Internet using the ASCII character set.

Since URLs often contain characters outside the ASCII set, URLs must be converted to valid ASCII format.

URL encoding uses "%" followed by two hexadecimal digits to replace non-ASCII characters.

URL cannot contain spaces. URL encoding usually uses + to replace spaces.

URL encoding example

Characters URL encoding
%80
£ %A3
© %A9
® %AE
À %C0
Á %C1
 %C2
à %C3
Ä %C4
Å %C5

For a complete URL encoding reference, visit our URL Encoding Reference Manual.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:Next article: