RewriteRule shows port number

Topics: User Forum
Jun 29, 2007 at 9:31 PM
Probably simple question. I am using IIRF to redirect a bunch of URLs to their new location on my webserver. I'm using the line:

RewriteRule ^/foo/bar/(.*).html /$1.php R=301

This puts the new address in the address bar, but includes the port number (e.g. Can I get rid of that :80? Thanks.
Jun 29, 2007 at 9:51 PM
I replaced

RewriteRule ^/foo/bar/(.*).html /$1.php /R=301/


RewriteRule ^/foo/bar/(.*).html$1.php /R=301/

So in my case the problem is solved (duh). but I'd still like an answer as to whether you can drop the port number.
Jul 3, 2007 at 10:18 PM
The filter code explicitly adds the port number when the redirect is written. I don't know why the author chose to add an explicit port number. I edited the source so that the port was not added and recompiled the filter.

An artifact of a redirect explicitly including the port number is that Safari (on the Mac) would show the port number in the browser address bar. That caused our Javascript XmlHttpRequests to fail, because the page was now coming from, however our javascript was still being included from XmlHttpRequest has security to reject any request that is not identical in protocol, domain and port number--apparently unspecified port vs explicit port is considered to be cross-site scripting.
Jul 13, 2007 at 5:54 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.