IIS - Help with Redirect of web site from default IIS to another local IIS

Asked By Mike Mike on 17-Feb-11 04:30 PM
Hi All,

I am struggling with configuring a solution and could use a hand.  I have a web server on our network that takes all the web traffic and works fine.  It is configured to support applications running in ASP and using SQL Server 2005.    It is running on a private IP of 192.168.100.10

Recently I have another web page that I need to host running with PHP and MySQL.  I added a completely different virtual server to host this web site.  It is running on IP of 192.168.100.20

Both are running IIS7.  I only have one public IP address.

I would like to have the current server (at IP 10) continue to get the incoming requests but if a request is for the new web site, have it redirect the user to the server running at IP 20.

I have looked at HTTP Redirection but cannot figure out how to enter the location value of the other IIS server if that is even the way to set it up.

Any help is appreciated.  Thanks
Mike

host headers - Robbe Morris replied to Mike Mike on 17-Feb-11 04:53 PM

You can host multiple IIS web sites under the same ip if you use host headers.  This is all done in the same section you assigned the ip address to the IIS web site.

There is no need for all that redirection mumbo jumbo.

In other words, you could have www.site1.com and www.site2.com using 192.168.100.10.  Then, if someone goes to http://www.site2.com it will use the IIS set you have designated with that ip address and site2.com as the host header.
Mike Mike replied to Robbe Morris on 18-Feb-11 01:45 AM
Hi Robbe,

Thanks for the reply.  I am not sure this is what I need, but I don't fully understand.

I need to have different web sites under different internal IP's.   I only have one external IP address so I am not sure how to do this.  I did try Host Header but not sure if I did it properly.  I have Host Headers setup to receive different websites and read them properly, but I need to get a particular site to a different internal server due to its configuration.

I hope that helps...and thanks again for the reply.

Why? - Robbe Morris replied to Mike Mike on 18-Feb-11 09:07 AM

"I need to have different web sites under different internal IP's."  Why must the different sites be under different ip addresses?  Host headers eliminates the need for this.
Hans Blum replied to Mike Mike on 10-Mar-11 09:55 AM
You can not host 2 websites on different web servers with only one external IP address (at least not without specific network devices that would support this).

As suggested by Robbe, you could simply host both websites on the same IIS web server, this would work by using host headers.

  • both DNS names (e.g.  www.a.com and www.b.com) will resolve to the same external IP address.
  • Request will go to the same IIS web server (with a router you would need to enable port forwarding to internal IP)
  • based on hostheader, either website a or website b will reply
If b must run on another server, you could set up an proxy (e.g. with Apache). The proxy must then be set up for both web sites, using virtual hosts. One would redirect to the local IIS webserver, while the other would redirect to the second webserver. To have Apache and IIS running, you need two IP addresses. IIS website on proxy server needs to run on another port than default.