Analysis and solution of the problem with slash and no slash at the end of URL

Source: Internet
Author: User
Keywords Website optimization

Intermediary transaction http://www.aliyun.com/zixun/aggregation/6858.html ">seo diagnose Taobao guest cloud host technology Hall

About the end of the URL need to bring a slash, this once let me struggle for a long time, because I contacted some sites everywhere there is such a problem, there are no slashes are included in Baidu, and some of the same keywords have rankings, when the site to do external links, 8630.html "> Sometimes in order to do with a slash or not with a slash link and headache, I believe many webmaster and I face the same problem. Then we'll analyze what's different about these two URLs, whether they have an impact on the site and how to deal with it.

Let's cite two examples:

Xxx.com/abc

xxx.com/abc/

I analyze it from several angles:

1, from the user's perspective analysis

From the point of view of user access, they do not affect the user experience, because they show the user is the same content page, and the user does not because the URL with a slash to change some behavior.

2, from the angle of Baidu analysis

If two pages are included in Baidu, and did not jump, then for Baidu is two exactly the same page, obviously there are duplicate pages, we know, repeat the page will result in the weight of dispersion, not conducive to SEO, or even because of repeated pages caused by too much weight.

3. Path analysis from two URLs

XXX.COM/ABC represents the ABC file in the root directory, and xxx.com/abc/refers to the default file in the ABC directory. When the spider crawls xxx.com/abc, the first is to read the ABC file to the root directory, can not find the ABC file will automatically read the root directory under the ABC directory under the default file; and when spiders crawl xxx.com/abc/, The first is to read the default file in the directory directly to the ABC directory under the root directory. This and crawl without a slash than the URL, save a step, under the same resources, can save read time, even if this time is very short, we have reason to choose to save, save spider bandwidth, That is, select 301 Redirect.

301 redirect represents permanent transfer (permanently moved), 301 redirect is the best way to search engine friendly after changing the address of the Web page, as long as it is not temporarily moved, it is recommended to use 301来 to do the transfer, transfer weight, do not cause weight loss. So how do you make 301 jumps? Different Web servers have different practices, and I share the next two more common server 301 Jump methods:

1, Apache server, you need to set up the. htaccess file, the code is as follows:

Rewritecond%{http_host} ^KANJIA.COM/LETAO[NC]

Rewriterule ^ (. *) $ http://kanjia.com/letao/$1 [r=301,l]

2, Windows IIS server, this server has several ways to do 301 jump, where I introduce a more commonly used and simple method:

Response.status= "Moved Permanently"

Response.AddHeader "Location", "http://kanjia.com/letao/"

Response.End

Change the URL in the code above to your URL and write it in your home page. After finished to webmaster tools inside the "HTTP status query" query, show the results of the following diagram will indicate success:

  

Share this with you today and hope to help you. This article by the http://kanjia.com Webmaster Original editor, A5 first, reproduced please specify, thank you.

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.