Use Web.config to set virtual host 301 Redirection

Source: Internet
Author: User

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

Web.config is a IIS7 new feature, so if you're still using IIS6, you don't need to read this article.

I won't say the benefits of 301 redirects. For me, the use of Web.config way to set 301 Redirect, is a more economical method, I do not have to set the redirect to buy another VPS, so my host cost under 300 yuan, of course, I was a small station, a movie site navigation. It can be said that my site on a page, although the virtual host provides 300MB of space, I used out of space no more than 1MB.

By web.config to set 301, the operation, that is, we have to manually modify the Web.config file. The file is located in the root directory of your Web site. If you don't, just create a new one.

The content section of the file, just like the following.

  

The content above replicates the website of self. Very simply, you can copy the above code into your web.config. If you're just doing 301 redirects, it's recommended that you empty the contents of your Web.config file and paste my code. Of course you have to modify the domain name for your own. For some of the instructions in the code, let me say what I understand.

Redirecttype= "permanent", which means permanent redirection, which is 301 redirects.

Url= "Http://www.xxxx.com/{r:1}", the URL here is naturally redirected.

Pattern= "^xxxx\.com|duodehen\.info|duodehen\.cn$", this part is to be redirected URL, you can see, I have a total of 3 domain names. The above settings are all without www, and they realize the function of course is to redirect without www to the address with www. What if you only have one domain name?

For example, you can write: pattern= "^xxxx\.com$".

Finally, you have to go to http://tool.chinaz.com/pagestatus/to check if your 301 is successful.

For example, my

  

Finally, give an answer to the questions that may arise, based on my own experience.

1, Baidu for more than 301 years will be effective?

15 days to 30 days

2, do 301 after Baidu how long time response?

2-3 days of time Baidu will know that you have done 301 redirects, this you can find through snapshots.

In other words, although your URL is original, but your snapshot content is redirected URL.

My site: www.youhenduo.com

Related Article

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.