0
votes

I have three applications(App1,App2,APP3) hosted under one website(Default Website) in IIS. I have created three DNS(http://website1.com, http://website2.com, http://website3.com) which will point to this IP address. Is it possible to show Application 1(app1) when the incoming request is http://website1.com , Application 2(app2) when the incoming request is http://website2.com and Application 3(app3) when the incoming request is http://website3.com

2
If you're using the same IP for all three sites, you will need to use host headers. - AaronS
How to add an host header to the application which is hosted under a website? - kishore
see my answer below, with a link on how to do it. - AaronS

2 Answers

3
votes

If you're using the same IP address for all three sites, you will need to configure host headers within IIS

See: http://technet.microsoft.com/en-us/library/cc753195%28v=ws.10%29.aspx

0
votes

Yes since this is a redirect, you can see for the referer Request agent to look into which of the website was visited before you got redirected here. Using these headers you will be able to get the website from where he is coming, website1 website2 or website3 and show the application you want to show there.

In the request headers below, see the referer as last page from where the user (I; in this case) came from to this page.

enter image description here

In ASP.NET you can that value as,

var previousPage = Request.UrlReferrer;

It is documented here: http://msdn.microsoft.com/en-us/library/system.web.httprequest.urlreferrer.aspx