Helicon ISAPI Rewrite Proxy 500 Internal Server Error

isapirewritewindows-server-2003

I have a website running at www.domain.com. The client now wants the website to appear to be running under www.otherdomain.com/whatson/brand/

Since the website is umbraco it won't run under a subfolder.

I wanted to use ISAPI rewrite to proxy requests to www.domain.com using the following rule in a .htaccess at www.otherdomain.com/whatson/brand/

RewriteRule ^(.*)$ http://www.domain.com/$1 [P,L]

However, when I apply this I get an ugly 500 Internal Server Error. There's nothing in the event log. So I turned on ISAPI logging and can see the following

111.111.111.111 111.111.111.111 Tue, 12-Jan-2010  13:05:24 GMT [www.otherdomain.com/sid#2045305275][rid#26337200/initial] (2) init rewrite engine with requested uri /whatson/brand/home.aspx

Then it testing all the other rewrite rules on the server.

Then this

111.111.111.111 111.111.111.111  Tue, 12-Jan-2010  13:05:24 GMT [www.otherdomain.com/sid#2045305275][rid#26337200/initial] (1) Htaccess process request w:\websites\otherdomain.com\docs2\whatson\brand\.htaccess
111.111.111.111 111.111.111.111  Tue, 12-Jan-2010  13:05:24 GMT [www.otherdomain.com/sid#2045305275][rid#26337200/initial] (3) applying pattern '^(.*)$' to uri 'home.aspx'
111.111.111.111 111.111.111.111  Tue, 12-Jan-2010  13:05:24 GMT [www.otherdomain.com/sid#2045305275][rid#26337200/initial] (2) forcing proxy-throughput with http://www.domain.com/home.aspx
111.111.111.111 111.111.111.111  Tue, 12-Jan-2010  13:05:24 GMT [www.otherdomain.com/sid#2045305275][rid#26337200/initial] (1) go-ahead with proxy request http://www.domain.com/home.aspx [OK]
111.111.111.111 111.111.111.111  Tue, 12-Jan-2010  13:05:24 GMT [www.otherdomain.com/sid#2045305275][rid#26337200/initial] (2) rewrite 'home.aspx' -> '/whatson/brand/home.aspxx.rwhlp?p=0'
111.111.111.111 111.111.111.111  Tue, 12-Jan-2010  13:05:24 GMT [www.otherdomain.com/sid#2045305275][rid#26337200/initial] (2) internal redirect with /whatson/brand/home.aspxx.rwhlp?p=0 [INTERNAL REDIRECT]

So it appears to work according to the logs, but I'm not seeing the page come through..

It's worth noting that www.domain.com and www.otherdomain.com are on the same box. LogLevel is 3 and RewriteLogLevel is 3 (I've tried with 9 and debug but there is too much traffic going through the other sites on the box)

Any ideas?

Best Answer

I've found this to be an issue with both the domains being on the same box.

The outgoing proxy request was unable to resolve to the local machine. Weird.

Added 127.0.0.1 www.domain.com to the hosts file and it's working.