How can I use host http://192.168.2.27
but my back end will display http://192.168.2.21
?
Sample:
When i type www.google.com
in my browser, I want it to go to wwww.yahoo.com
but the url address will not display the www.yahoo.com
. I think I can manipulate it in ii7 but I don't know how to do it.
I'm using windows server 2008.
You have to install the Application Request Routing ARR module which allows IIS to acts as a reverse proxy server. The module is available for free from Microsoft and will allow you to do exactly what you want.
UPDATE: It's really straight forward to set up. For more information see this blog post on MSDN. For you scenario you basically set up an empty website on
192.168.2.27
with just a web.config that will take care of setting up the proxy rules. The content of this web.config will be (or similar) like this:For this to work you must of course enable the 'Enable proxy' checkbox in the 'Application Request Routing Cache' module. This module can only be configured at the server root level (i.e. the node with the name of you server in IIS Manager).
Also make sure that the response of
http://192.168.2.21
is not gzip compressed otherwise the URLRewrite module will not be able to rewrite the links in the response.The other solutions are technically better than my suggestion. They're more complex too. If this is something which doesn't have to be very 'clean' then a way to do this would be to redirect www.google.com, using your internal dns server, to your internal web server. In IIS you create a site which responds to www.google.com. On this site you create a default page which has a single iframe which fills the page and contains www.yahoo.com.
Its not elegant but it would work. It all depends on how resilient it has to be and how it has to appear. Lots of things would not work - like opening links in another window.