I have an Azure VM that is hosting a web application.

The application will be accessible via the VM's IP address:

I want to be able to use query strings to redirect to completely different sites that are within the local IIS. For example:

would redirect to


The way I have structured IIS can be seen below:

enter image description here

Each site has an entry in the systems host file. wwww.site1.com wwww.site2.com wwww.site3.com

There is likely a better way to achieve what I am going for here so any pointers would be greatly appreciated.



Here is what i would do :

First, you need to download and install the URL Rewrite extension for IIS (A reboot, so a downtime, may be required to activate the extention).

You will need to update your DNS creating A or CNAME records for other web Sites, e.g :

www.site1.com. IN A
www.site2.com. IN A
www.site3.com. IN A

You will need a main entry site that will respond to Let use the "Default Web Site" for this. Configure the Bindings for this "Default Web Site" so that its Host Header is set to :

enter image description here

You need to set the appropriate Host Header within the Binding for site1.com :

enter image description here

Enter the URL Rewrite module for "Default Web Site" and create a new rule :

enter image description here enter image description here enter image description here

You will need to uncheck "Append query string" to remove ?site=1 once redirected. Then "Apply".

Proceed the same way for other sites wwww.site2.com and wwww.site3.com

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.