IIS6 iis7 use web. config for 301 redirection

Source: Internet
Author: User

In IIS6, we can easily set 301 redirection for a site.

You can set it directly on the Directory tab of the IIS Site properties.

Iis7 redirection in Windows 8 is also so simple:

The following is a repost of someone else.Article

By default, the "HTTP redirection" function of IIS is not installed. We need to manually install this role.

On the desktop, right-click "computer", select "manage", expand "role", select Web Server (IIS), and drag down on the left

Here, you can see whether HTTP redirection is installed. If not, click "add role service" to install it (no disk is required)

Redirection is a way to ensure that users always receive the pages they need. Redirection refers to the process of configuring the Web server to send a redirection message (such as HTTP 301) to the client to re-submit a request for a new location. We can redirect users to other files, directories, or sites.

Redirection is useful in the following scenarios:
-Changed the website location and wanted to redirect the user to the new site. Content from bnxb.com

-The website is under construction, so you want to set some functions of the site to unavailable. Bnxb.com

-The content is not stored on the Web server. Content from bnxb.com

-Changed the name of the virtual directory and expected users to access the file using the original URL.

This article is from origin

(1) configure the Web server to redirect requests to the target
Content from bnxb.com

If you want to redirect the client to a file, directory, or site, you need to enable redirection and configure the target. This configuration is useful if your site is under construction or you have changed the logo. Bnxb.com

The target you configured is relative. For example, if you configure the redirection target to http://www.bnxb.com/sales, and the request to pass to the http://www.bnxb.com/marketing/default.aspx,IIS, the request is redirected to http://www.bnxb.com/sales/default.aspx. Bnxb.com

1. Open the IIS manager and navigate to the level to be managed.

2. In "function View", double-click "HTTP redirection ". This article is from origin

3. On the "HTTP redirection" Page, select "redirect requests to this target ". In the corresponding box, type the file name, directory path, or URL to redirect the user. Bnxb.com

4. In the actions pane, click applications ".
Content from bnxb.com

(2) configure the Web server to redirect requests to the exact target

 

<Rules>
<Rule name = "blog301" stopprocessing = "true">
<Match url = "^ (. *) $" ignorecase = "false"/>
<Conditions logicalgrouping = "matchall">
<Add input = "{http_host}" pattern = "^ shionco.com $"/>
</Conditions>
<Action type = "Redirect" url = "http://www.shionco.com/?r}" redirecttype = "permanent"/>
</Rule>
</Rules>

<Rule name = "www 301 redirect" stopprocessing = "true">
<Match url = ". *"/>
<Conditions>
<Add input = "{http_host}" pattern = "^ wecanwecan.com $"/>
</Conditions>
<Action type = "Redirect" url = "http://www.wecanwecan.com/?r:0 }"
Redirecttype = "permanent"/>
</Rule>

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.