Setting Up 301 Redirects using UrlRewrite

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


<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>

		<rewrite>
		  <rules>
			 <clear />
		 
				<rule name="rule1" stopProcessing="true">
				<match url="shop/shopexd.asp?" />
				<conditions>
					<add input="{QUERY_STRING}" pattern="id=123" />  
				</conditions>  
				<action type="Redirect" url="shop/prod/431-somee-page" appendQueryString="false" />
				</rule>

		  </rules>
		</rewrite>

    </system.webServer>

</configuration>