Configure the Web Server to Redirect Requests to an Exact Destination (IIS 7)

Applies To: Windows 7, Windows Server 2008, Windows Server 2008 R2, Windows Vista

Configure the redirection destination to be an exact destination when you want to change the default redirection behavior. When you configure the destination to be an exact destination, all incoming requests are redirected to the exact destination instead of the relative destination. This is useful when you want all requests to be redirected to the same Web page, such as when a site is down for maintenance or when it is undergoing construction.

Note

You must first enable redirection and configure the redirection destination. For more information about how to enable redirection and configure the destination, see Configure the Web Server to Redirect Requests to a Relative Destination (IIS 7).

Prerequisites

For information about the levels at which you can perform this procedure, and the modules, handlers, and permissions that are required to perform this procedure, see HTTP Redirection Feature Requirements (IIS 7).

Exceptions to feature requirements

  • None

To enable redirection

You can perform this procedure by using the user interface (UI), by running Appcmd.exe commands in a command-line window, by editing the configuration files directly, or by writing WMI scripts.

User Interface

To use the UI

  1. Open IIS Manager and navigate to the level you want to manage. For information about opening IIS Manager, see Open IIS Manager (IIS 7). For information about navigating to locations in the UI based on your IIS administrative role, see Navigation in IIS Manager (IIS 7).

  2. In Features View, double-click HTTP Redirect.

  3. On the HTTP Redirect page, under Redirect Behavior, select Redirect all requests to exact destination (instead of relative to destination).

  4. In the Actions pane, click Apply.

Command Line

To configure the redirection destination to be an exact destination, use the following syntax:

appcmd set config /section:httpRedirect /exactDestination:true | false

By default, this attribute is false, but you can specify true for the exactDestination attribute. To do this, type the following at the command prompt, and then press ENTER:

appcmd set config /section:httpRedirect /exactDestination:true

For more information about Appcmd.exe, see Appcmd.exe (IIS 7).

Configuration

The procedure in this topic affects the following configuration elements:

<exactDestination> attribute of the <httpRedirect> element

WMI

Use the following WMI classes, methods, or properties to perform this procedure:

  • HttpRedirectSection.ExactDestination property

For more information about WMI and IIS, see Windows Management Instrumentation (WMI) in IIS 7. For more information about the classes, methods, or properties associated with this procedure, see the IIS WMI Provider Reference on the MSDN site.

See Also

Concepts

Configuring HTTP Redirection in IIS 7