Setting method for 301 redirects under IIS7.5 (and pseudo-static 301 redirect Error cases) _win server

Source: Internet
Author: User
Tags http redirect

One, 301 redirect implementation:

Our site (www.b.com) The original domain name is a.com, significantly worse, after changing the domain name, the first thing to do is naturally 301 redirect.

One caveat: even if you are not changing the domain name, you should also consider "B.Com" 301 Redirect to "www.b.com".

Everyone's environment is different, because we are using the cloud server, so we implement 301 redirect relatively simple, as long as in IIS directly set the line.

But before implementing, must remember: in IIS for each domain name establishes the independent site, completes the corresponding binding.

For example, you want to redirect "B.Com" 301 to "www.b.com", you should build two sites, and independent binding, and then in the "B.Com" site to do redirection settings.

Below, is the implementation step

First step:

Select HTTP Redirect

Step Two:

1, check "REDIRECT requests to this target" 2, enter the target domain name, 3, select "301 Permanent" can. The following figure:

Step Three:

It is natural to verify that the setting is successful:

1, you can use the following tools, input 301 redirect before the original domain name or URL, look at the return of the status code is 301;http://tool.chinaz.com/pagestatus/

2, input 301 redirect before the original domain name or URL, set the correct words, should be transferred to the new domain name under the corresponding page. (My question, just out here)

Second, pseudo static after 301 redirect error:

Problem:

I encountered a problem here, we pseudo static URL format is similar to this, a physical examination package: http://www.b.com/pkg-detail/ok327a455b6ed8c;

Results after 301, access to the original address http://www.a.com/pkg-detail/ok327a455b6ed8c;

But all become the original Dynamic Web site, such as "/pkg/detail.aspx?xxxxxxx", and the parameters of the total chaos, although the page return state is 301, correct, but the content has been completely wrong, or empty content, or even 404.

Reason:

After the investigation, originally, I built a new domain name site, directly copied the original directory.

The original site content is still fully retained, and we are pseudo static with the global scheme, the original site of the global.aspx file in trouble;

It is estimated that, when the visit, the URL has been the original site global.aspx processing, and then redirected to the new site, and the new site global.aspx processed once, so error. Solve:

The solution is very simple: the original site of the global.aspx, or empty files, leaving only a web.cnfig, fix.

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.