IIS Redirect

Written by

in

Configuring a web server redirect is a fundamental task for maintaining SEO rankings, forcing secure HTTPS connections, and ensuring a seamless user experience during domain migrations. In Microsoft Internet Information Services (IIS), you can achieve this through two native methods: the lightweight HTTP Redirect Feature or the advanced, highly flexible URL Rewrite Module. This step-by-step guide covers how to set up both options seamlessly. Method 1: Using the Native HTTP Redirect Feature

This method is perfect for straightforward domain-to-domain forwarding or redirecting an entire directory structure. Step 1: Install the HTTP Redirect Role Service

Before configuring the rule, ensure the HTTP Redirect component is enabled on your Windows Server. Open the Server Manager dashboard. Click Manage > Add Roles and Features. Proceed to Server Roles.

Expand Web Server (IIS) > Web Server > Common HTTP Features.

Check the box for HTTP Redirect and complete the installation. Step 2: Configure the Redirect in IIS Manager Open the Internet Information Services (IIS) Manager.

In the Connections pane, expand your server node and click the Sites folder. Select the specific website you want to redirect.

In the middle Home pane, locate and double-click the HTTP Redirect icon.

Check the box labeled Redirect requests to this destination.

Type your destination URL (e.g., https://newdomain.com) into the text box. Step 3: Select Redirection Behavior & Status Codes

Under the redirection settings, adjust the fine-tuning options:

Redirect all requests to exact destination: Keeps users on the homepage of the target site regardless of the sub-page they initially typed.

Only redirect requests to content in this directory: Limits the redirect behavior strictly to the target folder.

Status Code: Select Permanent (301) to pass link equity for SEO purposes, or Found (302) if the change is temporary.

Click Apply in the right-side Actions pane to save your changes. Method 2: Using the URL Rewrite Module (Recommended)

For complex tasks like forcing HTTP to HTTPS redirection, the free extension URL Rewrite Module provides much more control through precise logic. Step 1: Install URL Rewrite

Download the extension from the official Microsoft URL Rewrite Module page.

Complete the installation wizard and restart your IIS Manager. Step 2: Create an HTTP to HTTPS Redirection Rule

Performing a HTTP redirect in IIS Windows 2008 | Pluralsight

Open IIS Manager by clicking on Tools in the taskbar and then Internet Information Services (IIS) Manager. Once IIS Manager opens, Pluralsight Creating Rewrite Rules for the URL Rewrite Module

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *