url定位符_什么是URL(统一资源定位符)?

url定位符

url定位符

Uniform Resource Locator a.k.a. URL is a resource naming or locating format used to specify or address the resource. URL is very popular with the web where web sites and web resources are addressed or identified with URL format.

统一资源定位符(又称URL)是一种资源命名或定位格式,用于指定或寻址资源。 URL在Web上非常流行,在Web上使用URL格式寻址或标识网站和Web资源。

网址语法 (URL Syntax)

URL has a very strict syntax which is defined in RFC 1738. It has the following syntax where some information about the resource is provided.

URL具有在RFC 1738中定义的非常严格的语法。它具有以下语法,其中提供了有关资源的某些信息。

scheme://location:port/file-on-server.htm?querystring=1
  • scheme is the protocol used to retrieve the URL resource which is generally HTTP, HTTPS, FTP

    scheme是用于检索URL资源的协议,通常为HTTP,HTTPS,FTP

  • location is the address of the resource which generally starts with the `www` to specify the web resources.

    location是资源的地址,通常以“ www”开头以指定网络资源。

  • port is the port number of the resource which is generally omitted because schemes have default port numbers that will be used implicitly. HTTP is 80, HTTPS is 443 etc.

    port是资源的端口号,通常将其省略,因为方案具有将隐式使用的默认端口号。 HTTP是80,HTTPS是443等。

  • file-on-server.htm is the resource name which is generally an HTML, JAVASCRIPT, CSS, IMAGE, etc.

    file-on-server.htm是资源名称,通常是HTML,JAVASCRIPT,CSS,IMAGE等。

  • querystring is a parameter provided to the resource which is used to put some data about the request.

    querystring是提供给资源的参数,用于放置有关请求的一些数据。

As an example, this syntax is implemented in the following example.

作为示例,此语法在以下示例中实现。

https://www.poftut.com/what-is-chmod-777/
  • https is the scheme or protocol we will use to communicate with the location or server

    https是用于与位置或服务器通信的方案或协议

  • www.poftut.com is the location or server we will communicate

    www.poftut.com是我们将要交流的位置或服务器

  • what-is-chmod-777 is the resource we want to get and use

    what-is-chmod-777是我们想要获取和使用的资源

We can see this example do not provide a port or query string as the port is default value provided by HTTPS – 443 and there is no query string as we do not need for this case

我们可以看到该示例未提供端口或查询字符串,因为该端口是HTTPS – 443提供的默认值,并且没有查询字符串,因为在这种情况下我们不需要

URL方案(URL Scheme)

The scheme is the protocol we will use during communication with the remote server or location. There are different schemes invented on the internet. Below we will example the most popular of them below.

该方案是我们在与远程服务器或位置进行通信期间将使用的协议。 互联网上发明了不同的方案。 下面我们将以最流行的例子为例。

  • HTTP is the main and most popular protocol used as a scheme. HTTP simply used to send a request to get remote resources which is generally an HTML, JAVASCRIPT, CSS, IMAGE, etc. HTTP is a stateless protocol where every request has to be managed separately by an HTTP server like Apache, Nginx.

    HTTP是用作方案的主要且最受欢迎的协议。 HTTP仅用于发送请求以获取远程资源,通常是HTML,JAVASCRIPT,CSS,IMAGE等。HTTP是无状态协议,其中每个请求都必须由HTTP服务器(如Apache,Nginx)分别管理。
  • HTTPS is another popular protocol and expected to be the most popular protocol in the next years. HTTPS is just an HTTP protocol secured with the SSL.

    HTTPS是另一种流行的协议,并且有望在未来几年成为最流行的协议。 HTTPS只是受SSL保护的HTTP协议。
  • FTP or File Transfer Protocol is a very old protocol that is used to transfer files or bulk data between server and client.

    FTP或文件传输协议是一种非常古老的协议,用于在服务器和客户端之间传输文件或批量数据。
  • TELNET is an interactive remote management protocol that provides a shell for the remote system. TELNET is generally used in management systems and network devices.

    TELNET是一种交互式远程管理协议,为远程系统提供外壳。 TELNET通常用于管理系统和网络设备。
LEARN MORE  What Is Default SFTP Port and How To Change SFTP Port Number?
了解更多信息什么是默认SFTP端口以及如何更改SFTP端口号?

网址位置 (URL Location)

Location is the address of the remote system. Location can be also named as a server as a remote system will serve its resources to the client. Location can be expressed in different ways like below.

位置是远程系统的地址。 位置也可以命名为服务器,因为远程系统会将其资源提供给客户端。 位置可以通过以下不同方式表示。

域名 (Domain Name)

The domain name is used to address a specific location or system. Domain names are used via Domain Name System or DNS. Computer networks work with IP Addresses. But as human beings, we need a more simple solution to name and use systems. We can name systems with domain names in a human-readable format. We can use the following names as domain or location name in URL

域名用于寻址特定位置或系统。 域名通过域名系统或DNS使用。 计算机网络使用IP地址。 但是作为人类,我们需要一个更简单的解决方案来命名和使用系统。 我们可以使用易于理解的域名来命名系统。 我们可以使用以下名称作为URL中的域名或位置名称

www.poftut.com

poftut.com

test.poftut.com

IP地址 (Ip Address)

Ip Address is a four-octet value which is delimited with the points like 192.168.1.2. IP addresses are used to address systems in a computer network. So we can use an IP address as a location like below. In this example, we will set the location as 192.168.1.1 with the HTTPS scheme.

Ip Address是一个四字节的值,用192.168.1.2之类的点分隔。 IP地址用于对计算机网络中的系统进行寻址。 因此,我们可以将IP地址用作如下所示的位置。 在此示例中,我们将使用HTTPS方案将位置设置为192.168.1.1

https://192.168.1.1/login.html

ipv6地址 (Ipv6 Address)

IPv6 is a newer version of IP Address. We can use IPv6 address the same as IP address.

IPv6是IP地址的较新版本。 我们可以使用与IP地址相同的IPv6地址。

URL端口 (URL Port)

Port is used to specify the location TCP or UDP port number. But TCP is the most popular port number with the HTTP, HTTPS protocols. Port numbers are generally used implicitly with the scheme or protocol like HTTP, HTTPS, FTP. So we do not provide port number explicitly. So the following examples are the same request or URL.

端口用于指定位置TCP或UDP端口号。 但是TCP是HTTP,HTTPS协议中最受欢迎的端口号。 端口号通常与HTTP,HTTPS,FTP等方案或协议隐式使用。 因此,我们没有明确提供端口号。 因此,以下示例是相同的请求或URL。

https://www.poftut.com/

https://www.poftut.com/

https://www.poftut.com:443/

https://www.poftut.com:443/

But we can specify the port number explicitly. In this example, we will specify the port number as 81 .

但是我们可以显式指定端口号。 在此示例中,我们将端口号指定为81。

http://www.poftut.com:81/test.html

Here are some protocols/schemes and defacto port numbers.

这是一些协议/方案和实际端口号。

  • HTTP – 80,8080

    HTTP – 80,8080
  • HTTPS – 443

    HTTPS – 443
  • TELNET – 23

    TELNET – 23
  • FTP – 21

    FTP – 21
  • LDAP – 389

    LDAP – 389
LEARN MORE  List of FTP Commands For Linux and Windows with Examples
了解更多Linux和Windows的FTP命令列表以及示例

URL资源(URL Resource)

A resource is the specific name of the resource we want to use on the remote location or server. The resource can be an HTML file, CSS file, JAVASCRIPT file, IMAGE file, PHP file, BATCH commands to run, API, etc. In regular usage, it will be a web page or HTML file. In this example, we will get the resource named run_command.html

资源是我们要在远程位置或服务器上使用的资源的特定名称。 该资源可以是HTML文件,CSS文件,JAVASCRIPT文件,IMAGE文件,PHP文件,要运行的BATCH命令,API等。在常规用法中,它将是网页或HTML文件。 在此示例中,我们将获得名为run_command.html的资源。

http://www.management.com/run_command.html

URL查询字符串 (URL Query String)

When we request a resource can provide some Query String. Query String can be used to provide special parameters to a resource request. For example, if we want to use / on poftut.com with the word linux we can use we can string like below. The query string key will be s and value will be linux like below.

当我们请求资源时可以提供一些查询字符串。 查询字符串可用于为资源请求提供特殊参数。 例如,如果我们想在poftut.com上将/linux一起使用,则可以使用如下所示的字符串。 查询字符串键将是s ,值将是linux如下所示。

https://www.poftut.com/?s=linux

在URL中提供用户名和密码 (Providing User Name and Password In The URL)

Up to now, we have used the location as a DNS name or IP address. But if we need to specifically use a user name and passwords we can use the following syntax.

到目前为止,我们已将该位置用作DNS名称或IP地址。 但是,如果我们需要专门使用用户名和密码,则可以使用以下语法。

scheme://username:[email protected]:port/resource?querystring
  • username is used to specify the user like ismail, john, admin.

    用户名用于指定用户,例如ismail,john,admin。
  • password is used to put the password of the user where we need authentication to use a specified URL or resource.

    password用于将用户密码放在需要身份验证的地方,以使用指定的URL或资源。

Username and password generally required in the HTTP, HTTPS, and FTP protocols to use the remote resource. In this example, we will authentication with the admin user and password 34qFQwer4r+.

HTTP,HTTPS和FTP协议中通常需要使用用户名和密码才能使用远程资源。 在此示例中,我们将使用管理员用户和密码34qFQwer4r+身份验证。

ftp://admin:[email protected]/

HTTP URL示例 (HTTP URL Examples)

In this part, we will provide different HTTP URL examples.

在这一部分中,我们将提供不同的HTTP URL示例。

http://www.poftut.com

http://45.79.133.118/

http://www.poftut.com/?s=grep

http://45.79.133.118/?s=grep

http://www.poftut.com:80

http://www.poftut.com:80/what-is-chmod-777/

HTTPS URL示例 (HTTPS URL Examples)

In this part, we will provide different HTTPS URL examples.

在这一部分中,我们将提供不同的HTTPS URL示例。

https://www.poftut.com

https://45.79.133.118/

https://www.poftut.com/?s=grep

https://45.79.133.118/?s=grep

https://www.poftut.com:80

https://www.poftut.com:80/what-is-chmod-777/

邮件网址示例 (Mail URL Examples)

In this part, we will provide different Mail URL examples.

在这一部分中,我们将提供不同的邮件URL示例。

mailto:[email protected]

FTP URL示例 (FTP URL Examples)

In this part, we will provide different FTP URL examples.

在这一部分中,我们将提供不同的FTP URL示例。

ftp://ftp.itu.edu.tr

ftp://ftp.microsoft.com
What Is URL (Uniform Resource Locator)? Infographic
What Is URL (Uniform Resource Locator)? Infographic
什么是URL(统一资源定位符)? 信息图

翻译自: https://www.poftut.com/what-is-url-uniform-resource-locator/

url定位符

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值