IIS / ASP.NET Url Rewriting Multiple Domains


I’m hosing a website using Microsoft Azure websites. I’m rebranding it and need to perform 301 redirects on a few domain names.


The solution is simple; use the URL rewriting modules of IIS by adding the rules to the web.config:

			<rule name="SmoochiepetsToAnimalGuardian" stopProcessing="true">
				<match url=".*" />
				<conditions logicalGrouping="MatchAny">
					<add input="{HTTP_HOST}" pattern="^(www.)?smoochiepets.(com|net)$" />
					<add input="{HTTP_HOST}" pattern="^(www.)?smoocheypets.(com|net)$" />
					<add input="{HTTP_HOST}" pattern="^(www.)?smoochypets.(com|net)$" />
				<action type="Redirect" url="http://www.animalguardian.net/{R:0}" redirectType="Permanent" />


What are your thoughts?

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.