1

Currently I have an IIS 8.5 server with a URL of:

subdomain.domain.com/application_instance_name_1

Under a site called Portal Application there are 3 instances of the application, one for each customer.

I would like to create a subdomain per customer and direct it to their version of the application under the Site called Portal Application, for example, Customer 1 would type in:

customer_1_name.domain.com

and in IIS it would be directed to the site and Application below:

Sites/Portal Application/customer_1_application

This is my first time posting on here, I did find something that maybe relevant here but its for Apache not IIS.

IF you need further information please let me know.

Thanks

brian

Community
  • 1
  • 1
Brian
  • 11
  • 5

1 Answers1

1

1) You need to install URL Rewrite and ARR module for IIS

2) Enable ARR. On the Application Request Routing page, select Enable proxy

3) Create rewrite rule

    <rewrite>
        <rules>
           <rule name="rewrite customer_1_name.domain.com" stopProcessing="true">
                <match url="(.*)" />
                <conditions logicalGrouping="MatchAll">
                    <add input="{HTTP_HOST}" pattern="^customer_1_name.domain.com$" ignoreCase="true" />
                </conditions>
                <action type="Rewrite" url="http://subdomain.domain.com/Portal Application/customer_1_application/{R:1}" />
            </rule>
        </rules>
    </rewrite>

P.S. You might have problem with your resources(images,styles,css,js). Because your html might contains absolute paths to resources

You can check this post, when author is creating outbound rule for fixing relative urls https://blogs.iis.net/carlosag/setting-up-a-reverse-proxy-using-iis-url-rewrite-and-arr

Victor Leontyev
  • 8,488
  • 2
  • 16
  • 36