I have a pretty standard set of rewrite conditions and rules to translate a "nice url" into the correct file name & query string. The rules work fine.

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ([^/]*)$            index.php?section=$1 [L,QSA]
I also have two instances of apache running to allow me to use the both php4 and php5 modules with apache. One server listens on 80 and the other on 81.

If the rewrite rule fires, the $_SERVER['SERVER_PORT'] value in PHP will end up as 80, irregardless of the original value.

I've done some further checks - running the cgi php and both PHP4 and PHP5 on other ports and I figure the the '80' is coming from Apache as part of the rewrite process.

Is it possible to frame the rewrite rule to ensure the rewritten url maintains the original port?