Setting Up 301 Redirects (IIS7 Servers Only)

This article applies only to Windows 2008 servers with IIS7.

IIS7 makes 301 redirects easy by integrating the redirects into the web.config.  Look at the examples below on how to specify 301 redirects in your web.config file:

  <location path="ComputerLab.asp">  
        <system.webServer> 
            <httpRedirect enabled="true" destination="Labs/" httpResponseStatus="Permanent" /> 
        </system.webServer> 
    </location> 
    <location path="EmailSpamSolution.asp">  
        <system.webServer> 
            <httpRedirect enabled="true" destination="Support/Spam.aspx" httpResponseStatus="Permanent" /> 
        </system.webServer> 
    </location> 
    <location path="MicrosoftOffice2007.asp">  
        <system.webServer> 
            <httpRedirect enabled="true" destination="Training/Help/Office2007.aspx" httpResponseStatus="Permanent" /> 
        </system.webServer> 
    </location>