Updated on November 15, 2022
By Dave Lawlor

Performing an HTTP redirect in IIS Windows Server

Utilize HTTP redirect options in IIS on Windows Server to avoid traffic and rankings loss in search engines when changing domain names or website architecture.

If you have a website and want to change domain names or if you need to change the architecture of your site, you won't want visitors following links from other sites and search engines such as Google to get an error while visiting your website. This can cause visitors to click away and a loss of rankings in the search engines.

Luckily there is a fairly simple and straightforward way to remedy the situation through the use of redirects.

Types of HTTP redirect

First, let's look at the different types of redirects that are available in IIS:

  • 301 – Permanent: This redirect tells the Web client that the location of the requested resource has moved permanently 
  • 302 – Standard: This redirect tells the Web client to issue a new request to the location specified
  • 307 – Temporary: This redirect tells the Web client to resend POST data, which prevents a Web browser from losing data when the browser issues an HTTP POST request
  • 308 -- Permanent: This redirect also tells the Web client that the location of the requested resource should be redirected permanently. 308s allow you to specify POST or GET requests on the target location. 

In most circumstances you will want to use a 301 or 308 redirect, as this will inform search engines to update their index with the resource's new location. In some cases a 302 will be appropriate if the change is going to be short term such as a special page that is seasonal.

For this article I will assume that you already have a site setup on a Windows Server 2008 system setup in a web server role, and are familiar with getting into IIS manager.

Installing IIS Manager on Windows Server 12

  1. Find Server Manager in the taskbar

  2. With Server Manager open, locate the Manage menu, and then click Add Roles and Features.

  3. Use Next to navigate through Add Roles and Features, selecting the installation type and the destination server. 

  4. The Server Roles page is where you’ll find the HTTP Redirection option. Click on Web Server (IIS) → Web Server → Common HTTP Features → HTTP Redirection.

  5. Click Next from Select Features and Install on the Confirm installation selections page.

HTTP redirect to a different URL in IIS manager

The first and most simple of the redirects will go from one domain to another, useful if you are changing domain names. 

  1. Open IIS Manager by clicking on Tools in the taskbar and then Internet Information Services (IIS) Manager. 

  2. Once IIS Manager opens, expand the Connections pane, then the Sites folder, and choose the original domain

  3. Click on HTTP REDIRECT in the main panel

  4. Place a check next to Redirect requests to this destination: and fill in the target url in the text box below. 

  5. In the Redirect Behavior we have several decisions to make about how we want the redirects to work. We’ll explore those more below.

  6. For a simple permanent redirect, leave everything unchecked and set a status of 301 in the dropdown menu. Click Apply to set the options.

The changes are now in place and if we use a tool like the live HTTP headers plugin for Firefox, it will allow us to see the status codes.

HTTP Redirection behaviors

Let's explore our options for redirect behaviors.

  • Redirect all requests to the exact destination – If this object is checked all requests no matter what the original destination will be redirected to the exact location in the text box above. If unchecked everything will be redirected relative to the destination.

  • Only redirect requests to content in this directory (not subdirectories) – By default, when you enable redirection, content can be served by subdirectories below the main directory. If you choose this option you can limit requests to just the directory you want without effecting the subdirectories.

  • Status Code – In this drop down you choose which status code to return when redirecting. As discussed earlier in this article your options are 301, 302, 307, and 308.

HTTP redirect a single page to another page on the same site in IIS manager

This type of redirect is especially useful when you might have some temporary changes to a webpage because of seasonal or holiday changes.

In the case of a seasonal page that will return to normal after a short time, it is best to use a 302 redirect. This lets search engines and other sites know that this change is expected and not to change their index or links.

  1. Select the site in IIS manager that you want to set the redirect for.

  2. In the Features window switch to Content View: Right click on the page you want to work with, and left click on Switch to Features View

  3. The page now selected in the Connections Pane, click on HTTP Redirect in the features pane

  4. Check the box next to Redirect requests to this destination, and fill in the destination page and set the dropdown menu to 302, and click Apply.

  5. Now if we navigate to your original page, you should be redirected to the new page. You can again use the Live HTTP Headers plugin for Firefox to view the redirect.

Dave Lawlor

Dave Lawlor has been working in the IT field since leaving the U.S. Army in 1996.  Working his way up from printer hardware repair to running a corporate datacenter for a multinational corporation, Dave has seen many environments throughout the years. Focusing on web sites and search engine optimization the last few years, with the release of Server 2008 it has renewed his passion for the Wintel platform and server technologies. David also runs Windows-Server-Training.com where he posts free videos and walk-throughs for a variety of server technologies. David currently works as a freelance technical consultant and writer for a variety of companies in the Chicago area. (MCTS, MCP, A+)