Rewrite to webserver running on a certain port

Topics: User Forum
Apr 29, 2009 at 6:25 PM
Edited Apr 29, 2009 at 6:30 PM
I have a website setup for the redirect: on host serverx
I want to rewrite any requests for to a web app running on serverx:####
I'm running IIS6. The web app is running a built-in web engine, not IIS.

I have configured what I think should work, but it's not working:
RewriteRule  ^/(.*)$  http://serverx:####/$1

I'm getting 404 errors when I try
But I am able to get to the website using http://serverx:####/

I'm assuming I have the rule set up incorrectly. A little help would be greatly appreciated.

Apr 29, 2009 at 7:22 PM

I've been doing what I can, and here's where I am so far

I've update the INI file to:

RewriteLogLevel 4
RewriteLog c:\temp\IIRFLog
RewriteCond %{HTTP_HOST} ^$
RewriteRule ^/(.*)$ http://serverx:####$1

According to the log file, it's rewriting the URL correctly. '' becomes 'http://serverx:####/'

But for some reason, I keep getting the 404 errors. Why?

May 1, 2009 at 9:14 AM
Edited May 1, 2009 at 9:15 AM
I think you want a REDIRECT, not a REWRITE.
But your rule is for a Rewrite.

To get Redirect, you need to use the [R] flag, or, use RedirectRule, if that is supported by the version of IIRF you're using.

Check the readme - read up on the difference between Redirect and Rewrite.
May 1, 2009 at 1:32 PM
From what I understand, a REDIRECT will change the URL in the client browser. The whole purpose of implementing this was to mask the port number. Since the web app doesn't run on IIS, we couldn't use the traditional IIS methods. That why I wanted to use IIRF to rewrite any requests for '' to 'http://serverx:####/'.
Jul 6, 2009 at 8:09 PM

Ahh, then what you want is a PROXY , and IIRF is not that. Check the readme for more info.