Jump to content

URL: Difference between revisions

From ICANNWiki
Added translate and languages tag and subtracted Chinese for separate article.
Line 27: Line 27:
The '''Absolute URL''' is a URL that is independent of other elements and points directly to an exact file location. For instance, "<big><code>mywebsite.com/images/homepage.jpg</code></big>" is an Absolute URL, which specifies that the image file homepage.jpg is located in the images directory, under the mywebsite domain.  
The '''Absolute URL''' is a URL that is independent of other elements and points directly to an exact file location. For instance, "<big><code>mywebsite.com/images/homepage.jpg</code></big>" is an Absolute URL, which specifies that the image file homepage.jpg is located in the images directory, under the mywebsite domain.  
   
   
A '''Relative URL''' is a type of URL that is dependent on other elements and point to a directory or file in relation to the present directory or file. For example, "<big><code>../image/homepage.jpg</code></big>." In this, the first two periods (..) direct the server to move up one directory (the root directory), then enter the images directory and point to the homepage.jpg file. The main benefit of a Relative URL is that it allows a web master to make changes to the directory without the worry of breaking a file path.<ref>[http://blog.webhosting.uk.com/web-hosting/types-of-url-absolute-and-relative/ blog.webhosting.uk.com]</ref>
A '''Relative URL''' is a type of URL that is dependent on other elements and point to a directory or file in relation to the present directory or file. For example, "<big><code>../image/homepage.jpg</code></big>." In this, the first two periods (..) direct the server to move up one directory (the root directory), then enter the images directory and point to the homepage.jpg file. The main benefit of a Relative URL is that it allows a webmaster to make changes to the directory without the worry of breaking a file path.<ref>[http://blog.webhosting.uk.com/web-hosting/types-of-url-absolute-and-relative/ blog.webhosting.uk.com]</ref>


== SEO benefits ==
== SEO benefits ==


In a new search engine trend, URLs, when shortened, can play a major role in the Search Engine Optimization ([[SEO]]) of a web site. Many SEO experts advise that a URL of the form: <big><code>www.yourwebsite.com/category/subcategory</code></big> leads to better search engine rankings.<ref>[http://webmasters.stackexchange.com/questions/4166/seo-benefits-of-url-as-www-example-com-category-subcategory webmasters.stackexchange.com]</ref> [[Google]], a leading search engine, has developed a URL shortener to convert longer URLs into short ones. The idea behind this is that, with shorter URLs, the sharing of links between people is made easier, which in turn can increase traffic to a web site.<ref>[http://www.htmlgoodies.com/daily_news/article.php/412820/The-SEO-Benefits-of-Googles-URL-Shortener.htm htmlgoodies.com] SEO benefits of Google URL shortner</ref>
In a new search engine trend, URLs, when shortened, can play a major role in the Search Engine Optimization ([[SEO]]) of a web site. Many SEO experts advise that a URL of the form: <big><code>www.yourwebsite.com/category/subcategory</code></big> leads to better search engine rankings.<ref>[http://webmasters.stackexchange.com/questions/4166/seo-benefits-of-url-as-www-example-com-category-subcategory webmasters.stackexchange.com]</ref> [[Google]], a leading search engine, has developed a URL shortener to convert longer URLs into short ones. The idea behind this is that, with shorter URLs, the sharing of links between people is made easier, which in turn can increase traffic to a web site.<ref>[http://www.htmlgoodies.com/daily_news/article.php/412820/The-SEO-Benefits-of-Googles-URL-Shortener.htm htmlgoodies.com] SEO benefits of Google URL shortner</ref>
=Chinese version of this page/本页中文版=
===统一资源定位符===
'''统一资源定位符'''是'''网页地址(URL)'''的全称。其前身被称为'''全球资源定位符''',是统一资源标识符的一种。URL是独一无二的地址或路径,用来定位某个文件的网络位置以及指定提取该文件的途径。
互联网上所有网站都有一个独特的网页地址, 可以在网页游览器的地址栏中输入它来浏览网站。URL也可以用来定位访问其他文件或资源,例如图像文件,主页以外的(HTML)网页,Java小应用程序以及嵌入网页中如通用网关接口(CGI)之类的编程程序。
网页地址包含指导网页游览器如何提取文件或资源的协议;识别储存该文件的网页服务器的域名;以及分层描述该文件在电脑上的具体地址的路径名。
== 代码语法结构 ==
典型的网页地址结构如下:
<big><code><nowiki>http://www.abcd.org/def/def1234.txt</nowiki></code></big>
这个网址的第一部分--http--是具体协议。超文本传输协议(HTTP)将HTML网页转移至互联网上。其他各种协议,如文件传输协议(ftp),Gopher协议(gopher),电子邮件地址(mailto)和广域信息查询系统(wais)也都有其各自的作用。HTTP和余下的URL以冒号隔开;余下的URL以针对HTTP的特定格式跟在冒号后面。
上述网页地址的第二部分--www.abcd.com--提供独特的网页浏览具体名称。该名称是按等级结构排序的域名,由右至左依次降级,并以点(.)分隔。最右边的是[[TLD|顶级域]]。
以斜杠(/)分隔开,跟在顶级域前面的是该资源的路径名,如例子中的def1234.txt这个文件。<ref>[http://searchnetworking.techtarget.com/definition/URL searchnetwork.techtarget.com]Definition URL</ref><ref name="ietf">[http://www.ietf.org/rfc/rfc1738.txt ietf.org]RFC 1738</ref><ref name="www">[http://www.w3.org/Addressing/URL/url-spec.txt w3.org]URL specifications</ref>
== 历史 ==
统一资源定位符由[[Tim Berners-Lee|蒂姆•伯纳斯•李]]和[[IETF|互联网工程任务小组]]于1994年发明。<ref name="www">[http://www.w3.org/Addressing/URL/url-spec.txt w3.org]URL specifications</ref> <ref name="ietf">[http://www.ietf.org/rfc/rfc1738.txt ietf.org]RFC 1738</ref>
蒂姆•伯纳斯•李原本设计网页地址是由点(.)分隔开来的,不过后来后悔了,想改成由斜杠(/)分隔。如下:
<big><code>http:com/sample/www/path/to/name</code></big> instead of <big><code><nowiki>http://www.sample.com/path/to/name</nowiki></code></big>。<ref>[http://www.w3.org/People/Berners-Lee/FAQ#etc w3.org] World Wide Web </ref>在发明URL二十年后,蒂姆•伯纳斯•李接受了泰晤士报的采访,竟然为设计在分隔冒号(:)后面使用双斜杠(//)这件事道歉。<ref>[http://news.bbc.co.uk/2/hi/technology/8306631.stm news.bbc.co.uk]</ref>
== 网页地址的种类==
网页地址分为'''绝对'''和'''相对地址'''两类。
'''绝对网页地址'''独立于其他元素,直接表示文件具体位置,如"<big><code>mywebsite.com/images/homepage.jpg</code></big>"便是一个绝对URL,表示该图像文件homepage.jpg位于mywebsite域名下的图像目录(images)。
'''相对网页地址'''受其他元素影响,以本身的文件目录或文件夹的位置为参考点来表示一个文件目录或文件夹。如在"<big><code>../image/homepage.jpg</code></big>."这个地址中,前面的两个点(..)指导服务器去高一层目录(根目录),进入图像目录中找出homepage.jpg这个文件。相对URL的最大好处在于其允许网站管理员更改文件目录,不必担心破坏文件路径。<ref>[http://blog.webhosting.uk.com/web-hosting/types-of-url-absolute-and-relative/ blog.webhosting.uk.com]</ref>
== 搜索引擎优化的益处==
在搜索引擎新趋势下,网页地址在缩短的情况下,对网页的搜索引擎优化([[SEO]])有很大的影响。许多SEO专家建议如<big><code>www.yourwebsite.com/category/subcategory</code></big>这种格式的URL可以优化搜索引擎排名。<ref>[http://webmasters.stackexchange.com/questions/4166/seo-benefits-of-url-as-www-example-com-category-subcategory webmasters.stackexchange.com]</ref>作为领先的搜索引擎的[[Google|谷歌]]已开发出URL缩短器将长地址转换为短地址。其中的理念是缩短的URLs可以简化用户之间的链接分享,从而提高网站流量。<ref>[http://www.htmlgoodies.com/daily_news/article.php/412820/The-SEO-Benefits-of-Googles-URL-Shortener.htm htmlgoodies.com] SEO benefits of Google URL shortner</ref>
''Chinese translation of this page was provided thanks to [[Allegravita]] LLC.''


== References ==
== References ==

Revision as of 21:58, 31 August 2015

URL is an abbreviation for Uniform Resource Locator. It was previously known as the Universal Resource Locator and is a type of Uniform Resource Identifier. The URL is a unique address or file path that represents the location of a file on the internet and also specifies the method to retrieve the resource from the location.

Every website on the internet has a unique URL, which can be entered into the address bar of a web browser to access and view it. Any other file or resource such as an image file, web (HTML) page other than the home page, Java applet and even programs imbedded inside a site, such as a Common Gateway Interface (CGI) application, can also be accessed using a URL.

The URL consists of a protocol that tells the web browser how to retrieve the file or resource; a domain name which identifies the specific web server on the Internet where the file is stored; and a pathname, which is a hierarchical description that specifies the location of the particular file on the computer.

Syntax[edit | edit source]

A typical URL is set up in the following way:

http://www.abcd.org/def/def1234.txt

The first part of the URL, in this case http, is the specified scheme. The HTTP (Hyptertest Transfer Protocol) scheme is used to transfer HTML pages on the web. Other protocols are ftp, gopher, mailto, and wais, which are all used for their own purpose. The scheme is separated from the rest of the URL by a colon; the rest of URL follows the colon in a format specific to the scheme.

The second part of the URL, in this case www.abcd.com, specifies a unique web server name. This name is a hierarchy of domains, descending from right to left and separated by a dot. The rightmost domain, or label, is the TLD.

Following the TLD, separated by forward slashes, is the location or pathname of a resource (in this example, a text file named def1234.txt), to be accessed on the computer.[1][2][3]

History[edit | edit source]

The URL was first created in 1994[3] by Tim Berners-Lee and the Internet Engineering Task Force's URI Working Group.[2]

Berners-Lee originally designed the URL to have the domain name separated by dots, but later regretted it, wishing he had designed the URL to be separated by slashed throughout, as in: http:com/sample/www/path/to/name instead of http://www.sample.com/path/to/name. [4] Twenty years after creating the URL, Tim Berners-Lee, in an interview with Times, went so far as to apologize for using the two forward slashes (//) following the colon separator.[5]

Types of URL[edit | edit source]

There are two types of URLs, Absolute and Relative.

The Absolute URL is a URL that is independent of other elements and points directly to an exact file location. For instance, "mywebsite.com/images/homepage.jpg" is an Absolute URL, which specifies that the image file homepage.jpg is located in the images directory, under the mywebsite domain.

A Relative URL is a type of URL that is dependent on other elements and point to a directory or file in relation to the present directory or file. For example, "../image/homepage.jpg." In this, the first two periods (..) direct the server to move up one directory (the root directory), then enter the images directory and point to the homepage.jpg file. The main benefit of a Relative URL is that it allows a webmaster to make changes to the directory without the worry of breaking a file path.[6]

SEO benefits[edit | edit source]

In a new search engine trend, URLs, when shortened, can play a major role in the Search Engine Optimization (SEO) of a web site. Many SEO experts advise that a URL of the form: www.yourwebsite.com/category/subcategory leads to better search engine rankings.[7] Google, a leading search engine, has developed a URL shortener to convert longer URLs into short ones. The idea behind this is that, with shorter URLs, the sharing of links between people is made easier, which in turn can increase traffic to a web site.[8]

References[edit | edit source]

  1. searchnetwork.techtarget.comDefinition URL
  2. 2.0 2.1 ietf.orgRFC 1738
  3. 3.0 3.1 w3.orgURL specifications
  4. w3.org World Wide Web
  5. news.bbc.co.uk
  6. blog.webhosting.uk.com
  7. webmasters.stackexchange.com
  8. htmlgoodies.com SEO benefits of Google URL shortner