IIS 301 redirects to the www. Domain name at the beginning

Source: Internet
Author: User
Tags iis variables resource domain domain name
Explain what is the permanent redirection of resources, popular simple understanding, when you enter sina.com.cn in the browser (Sina homepage), the URL is not become www.sina.com.cn? Again, some 163.com, qq.com will become the style of www.xxx.com, using a permanent redirect of resources, but they are not using IIS.

First of all, explain what is the permanent redirection of resources, popular simple understanding, when you enter sina.com.cn in the browser (Sina homepage), the URL is not become www.sina.com.cn? Again, some 163.com, qq.com will become the style of www.xxx.com, using a permanent redirect of resources, but they are not using IIS. This is just a way of saying that the parameters of permanent redirection are used in IIS. Here's how to use redirection in IIS6.0.
The premise hypothesis, in order to simplify the input here assumes two URLs: aa-represents alixixi.com,bb-Representative www.alixixi.com
How do I set the redirection method?
1. Open IIS Manager;
2. Expand the website, then select a site, right-click Select "Properties" and click on the "Home Directory" tab;
3. On the Home Directory tab you will see "The contents of this resource are from:" And here are 3 options, respectively:
"Directory on this computer (d)";
"Shared (s) on another computer";
"Redirect to URL (u)"
4. Select Redirect to URL (u), and the following options follow the changes
The "redirect to (C):" Entry box appears where you want to enter the resource redirection URL.
Second, give examples to illustrate the method of redirection
1. Goal: To redirect a aa to BB
2. Method: Set the host header of AA and BB respectively in IIS, according to the method described in the "one" in the AA "redirect to the URL (U)" in the input BB URL, and then select the "above entered the exact URL" and "Permanent Resource redirection" (best choice, or search engine will think you are cheating , the HTTP return value is also correctly responded to by 301, so that a AA redirect can be done to the BB.
3. Test: Enter a AA in the browser, see if it becomes BB?
Third, with the parameter of AA how to redirect to BB
If you test http://alixixi.com/index.shtml?id=1&host=www.xpcolor.com this URL according to the method in "two", The browser accesses the www.alixixi.com, and the subsequent arguments are not redirected, so how do I take the parameter redirection? Keep looking down.
1. Goal: redirect http://alixixi.com/index.shtml?id=1&host=www.xpcolor.com to Http://www.alixixi.com/index.shtml?id=1 &host=www.xpcolor.com
2. Method: This time to "redirect to the URL (U)" Inside the input parameters, input parameters at the end of this article, input http://www.alixixi.com$s$q in the input box
3. Test: This time to enter http://alixixi.com/index.shtml?id=1&host=www.xpcolor.com again to see if it is correct to be redirected to http:// Www.alixixi.com/index.shtml?id=1&host=www.xpcolor.com, huh?
Four, redirect parameters
$S-passes the suffix of the requested URL to the new URL. The suffix is the part of the initial URL that is reserved after the redirected URL is substituted. If the exact_destination flag is not set, the name of the resulting destination URL will have the name of the requested file (as the folder name) and the file name itself.
$P-Passes the parameters in the initial URL, such as the QueryString parameter, to the new URL, excluding the question mark (?).
$Q-Passes the parameters in the initial URL, such as the QueryString parameter, to the new URL, including the question mark (?).
$V-Passes the requested URL, excluding the server name and any parameters. To include parameters, you can use $P or $Q variables and $V variables. If the exact_destination flag is not set, the name of the resulting destination URL will have the name of the requested file (as the folder name) and the file name itself.
There are a lot of parameters, basically the most commonly used is $s and $q, any Web site to achieve 301 permanent redirect just set the $s and $q can be.



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.