Hosting multiple domains under one Azure Website

When you have multiple domain names and have only one Azure website, you can use IIS URL Rewrite to host multiple domains. What do you need? At least one Windows Azure website in shared mode.

Add you domain names to this Windows Azure website. This is not possible when you use the free Windows Azure websites.

The following folder structure we need, every domain has his own folder:

    • domain1
    • domain2
    • domain3

Add to the root folder the file web.config and add the following xml:

<?xml version="1.0"?>

        <rule name="" stopProcessing="true">
          <match url=".*" />
            <add input="{HTTP_HOST}" pattern="^(www.)?domain1.(com|nl)" />
            <add input="{PATH_INFO}" pattern="^/domain1/" negate="true" />
          <action type="Rewrite" url="\domain1\{R:0}" />


In this example we use the IIS rewrite rules to manage the requests for and and forward this to the subfolder domain1. Add as many domains and rules you like.

Need more information about IIS Rewite, please go to Scott Forsyth's Blog.

Skip to main content