Capturing Port Number in ReWriteCond Host:

ISAPI_Rewrite is a powerful URL manipulation engine based on regular expressions
User avatar
Posts: 1
Joined: 25 Feb 2013, 08:45

Capturing Port Number in ReWriteCond Host:

25 Feb 2013, 09:00

Hi Guys, hope you can help.

We have a website that we want to setup within ISAPI_ReWrite 2.x. The nature of the website means that we want to use non standard ports.

So the URL to get to it is say http://www.abcdefg.com:58000
Our firewall does a port redirection from this address to the reverse proxy server on port 80
The ISAPI_ReWrite takes over with the following rule:

RewriteCond Host: www.abcdefg.com
reWriteRule (.*) http://10.10.10.10:8081$1 [I,P]

However this doesnt work. The log is empty and always have been.

I think it may be because the initial user URL contains port 58000 and this is not included in the ReWriteCond Host: rule? I have tried adding it but it generates a internal server error.

Does anybody know how to do this?

User avatar
Posts: 19
Joined: 21 Mar 2012, 06:22

Re: Capturing Port Number in ReWriteCond Host:

25 Feb 2013, 10:00

Try this:

RewriteCond Host: www.abcdefg.com(?:\:\d+)
RewriteRule (.*) http\://10.10.10.10\:8081$1 [I,P]

Return to ISAPI_Rewrite 2.x

Who is online

Users browsing this forum: No registered users and 2 guests