What does the content of the url include?
On the WWW, each information resource has a unified and unique address on the Internet. This address is called URL (Uniform Resource Locator, Uniform Resource Locator), which is WWW The Uniform Resource Locator indicates the network address.
URL consists of three parts: resource type, host domain name where the resource is stored, and resource file name.
The general syntax format of URL is:
(with square brackets [] is optional):
protocol ://hostname[:port] / path / [;parameters][?query]#fragment
1. Mode/protocol (scheme): It tells the browser how to handle the file to be opened. The most commonly used mode is the Hypertext Transfer Protocol (HTTP), which is used to access the Internet. Other protocols are as follows:
http——超文本传输协议资源 https——用安全套接字层传送的超文本传输协议 ftp——文件传输协议 mailto——电子邮件地址 ldap——轻型目录访问协议搜索 file——当地电脑或网上分享的文件 news——Usenet新闻组 gopher——Gopher协议 telnet——Telnet协议
2. The name or IP address of the server where the file is located, followed by the path to the file and the name of the file itself. The server name or IP address is sometimes followed by a colon and a port number. It may also contain the username and password required to contact the server. The path part contains the path definition of the hierarchical structure. Generally, different parts are separated by slashes (/). The query part is generally used to transmit the parameters required for dynamic query of the database on the server.
Example:
Assume this is a url address http://localhost:8080/a/b/c?a=1&b=2#abc, which contains:
protocol: 'http:',//协议 host: 'localhost:8080', port: '8080',//端口 hostname: 'localhost',域名 hash: '#abc', search: '?a=1&b=2' 等于 ?query: 'a=1&b=2', pathname: '/a/b/c', path: '/a/b/c?a=1&b=2', href: 'http://localhost:8080/a/b/c?a=1&b=2#abc'
The above is the detailed content of What does the content of the url include?. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

