Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

guys! We have here to web servers behind a router - one IIS and one Tomcat (on different machines / IP addresses). The domain is pointing to out external IP, which is forwarded to IIS (internal IP 192.168.1.10 for example). I'm trying to do the following: when [www.]ourdomain.com is entered the default web site on IIS have to be loaded (this part is ok), but when test.ourdomain.com is entered I want to redirect this request to another web server (192.168.1.11 for example). I created a site "test" on IIS and it is displayed when test.ourdomain.com is entered. Then I tried to redirect it with following rule: Requested URL matches the pattern: * (using wildcards) Condition: {HTTP_HOST} matches test.ourdomain.com Action type: Rewrite Rewrite URL: http://192.168.1.11/{R:0} but when I try to load test.ourdomain.com now I get IIS's error 404 page. Obviously I'm wrong :-) How can I do such a redirect?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

A rewrite needs to be a relative path on disk, under the same website. That's what is causing the 404 error in your case.

A redirect will send a client-side redirect, but that won't work since 192.168.1.11 is an internal IP that can't be accessed publicly.

What you need is ARR: http://www.iis.net/expand/ApplicationRequestRouting. It's a reverse proxy and will take the public request and forward it on to the internal server. This is the middle man between the client and the internal server. It leverages IIS and URL Rewrite so you're already much of the way there.

share|improve this answer
    
Thanks! I'll take a look on this. –  Andrew Mar 16 '10 at 7:24
    
This helped me today - I thought you could rewrite to anything under the same domain (including different subdomains), but it wasn't working! Now am doing relative path, and dropping the subdomain component. Works great. –  Matt May 17 '10 at 22:21
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.