IIS server to do 301 permanent redirection settings explain

  
                  

I didn't care much about 301 redirects. First, because there is no website to redirect, second, for domain names without www, I used to forward to the domain with www. However, after a storm, many service providers have not provided forwarding services.

And now the domain name is also popular overseas, the forwarding is not used, and can only be used IIS, 301 permanent redirect, otherwise the search engine website is to separate the station without www and the station with www It’s just that we are used to using the domain name with www.

After reading some tutorials on the network, and then according to their own practice, they finally settled the 301 permanent redirection settings on the IIS server. The successful implementation method is as follows:

1. Create a new site, corresponding to the directory such as E:\\wwwroot\\301web. Only one file is required in this directory, namely index.html or add a 404.htm. To jump binding domain, as shown:




2. Select the site, right, property, home directory we just created in IIS Select Redirect to, enter the URL such as: http://www.45it.com, and note the permanent redirection option for the resource below. As shown below:




3. So far, we have completed the 45it.com 301 redirect this domain name to www.45it.com work .

Note:

“ Enter the exact URL (X) above; this option is not recommended here.

The result of not selecting is:

When you enter 45it.com and go to www.45it.com,

When you enter 45it.com/sanwen/suibi/, turn Go to www.45it.com/sanwen/suibi/.

The result of the selection is:

When you type 45it.com or 45it.com/sanwen/suibi/you will be redirected to www.45it.com.

Well, if you just want to transfer the domain name without www to www or other unused domain names to the domain name you are using, this is fine. But if the domain you want has already done the website and want to pass the weight to the new website, you can refer to the following method:

The first step is the same as above, mainly the second step, as shown in the figure:




Notice the red font section, behind redirected to address more than $ S $ Q character, that wrote the http://www.45it.com $S$Q. “ Enter the exact URL(X)” this option is also checked.

For the $S$Q character, explain here:

$S Pass the suffix of the requested URL to the new URL. The suffix is ​​the portion of the initial URL that is retained after the redirected URL is replaced.

If the EXACT_DESTINATION flag is not set, the name of the resulting target URL will have the name of the requested file (as the folder name) and the file name itself.

$Q passes the parameters in the initial URL (such as the querystring parameter) to the new URL, including the question mark (?).

If you don't add the $S$Q character, the 301 of the inner page will jump to the home page. The purpose of adding the $S$Q character is that the inner page can also accurately jump to the corresponding new domain name. Inside page.

Ok, so that the 301 permanent redirection setting is completed. After setting it, it is best to test whether it returns 301 value.

Baidu's response to 301 is not as slow as imagined. The next day, the 45it.com page is included, with the latest snapshot. Of course, the content of the snapshot is the content of www.45it.com, not the content of index.html in 301web.

Copyright © Windows knowledge All Rights Reserved