Summary of the difference between a slash/and a backslash \ in a URL

Source: Internet
Author: User

./src/this writes the SRC folder in the current directory;

.. /src/this to indicate that the current directory in the previous level of the directory in the SRC folder;

/src/this to indicate that the project root directory (can only disk root directory, can also refer to the project root directory, depending on the actual situation)

UNIX uses a diagonal bar/As a path delimiter, and Web apps are most recently used on UNIX systems, so all network addresses currently use a slash/delimiter.
Windows is marked with the use of a diagonal bar/As a parameter of the DOS command prompt, and in order not to be confused, use the backslash \ as the path delimiter. So the file browser on the Windows system is now using the backslash \ as the path delimiter. With the development of the DOS system has been eliminated, the command prompt is also used very rarely, the oblique bar and the backslash in most cases can be interchanged, no impact.

Knowing this background, you can summarize the conclusion:
(1) The browser address bar URL using the diagonal bar/;
(2) The Windows file Browser uses a backslash \;
(3) The path that appears in the HTML URL () attribute, the specified path is a network path, so you must use a diagonal bar/;

(4) The path that appears in the normal string, if it represents a Windows file path, uses the slash/and backslash \ is the same, or if the network file path is represented, you must use a diagonal bar/;

We can often see two kinds of URLs

1.http://www.abc.com/abc

2.http://www.abc.com/abc/

Is there any difference between the two URLs? which is better for SEO? This problem has plagued me for a long time, because I am a person who is very pursuit of perfection, these two URLs although only a small difference, but I still want to use the best one for my site. For the user, in most cases these two URLs do not have any difference, they are access to the site ABC directory of the default home page. The average user also knows that the last slash is optional, and when they enter the URL, they usually enter HTTP://WWW.ABC.COM/ABC.

When the Web server receives a URL request that does not contain a slash at the end, such as "HTTP://WWW.ABC.COM/ABC", then the server searches for a file that has the name "abc" in the root directory of the Web site, and if not, the ABC is treated as a directory. Then return to the default home page under the ABC directory. When the Web server receives a request with a slash at the end, it is treated directly as a directory.

This is an article seen in Microsoft IEBlog: http://blogs.msdn.com/ie/archive/2005/04/11/407189.aspx

When generating hyperlinks, always include a trailing slash if possible. For instance, navigating to http://msdn.microsoft.com/ie takes one more roundtrip than http://msdn.microsoft.com/ie/. When the browser navigates-the/ie URL, the server merely sends down a 301 to The/ie/url. Both links work, and the second version is faster.

In a nutshell, when the browser parses a URL such as/ie, the server performs 301 turns to/ie/and two links are valid, but the second one is faster. Of course, the time of the steering is generally not felt, can almost be ignored. For the search engine, this two address is possible at the same time, the last in a Master SEO blog to see, said a keyword search results, a site with "/" and without "/" the Web site at the same time appear in the search results of the homepage, Baidu should be a bug, do not know that there are no.

Wikipedia links are in the form of non-"/", such as http://en.wikipedia.org/wiki/Search_engine_optimization, you can see Wikipedia related pages of the situation, Included is also not with the "/" URL.

Maybe a lot of friends see this don't understand, that in the end what kind of form?

My point of view and the majority of SEO experts agree, that is, in the directory form the end of the URL with "/", especially when exchanging links, links are used http://www.xxxx.com/This form, must pay attention to OH. For those who have adopted without the "/" URL, it does not matter, you can continue to use this form of URL like Wikipedia, but pay attention to the unity of the link, not some places with "/", some places with no "/", if you do not want to retain this link, You can directly link all 301 to the "/", and later in the site all with the "/" URL.


Source: <http://www.admin5.com/article/20101228/303145.shtml>   Source: <http://www.jb51.net/article/52650.htm>  

From for notes (Wiz)

Summary of the difference between a slash/and a backslash \ in a URL

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.