You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2013/05/30 09:27:00 UTC

[Bug 55029] New: Up to apache-2.2.24 mod_rewrite interpretes port suffix as a part of HTTP_HOST

https://issues.apache.org/bugzilla/show_bug.cgi?id=55029

            Bug ID: 55029
           Summary: Up to apache-2.2.24 mod_rewrite interpretes port
                    suffix as a part of HTTP_HOST
           Product: Apache httpd-2
           Version: 2.2.24
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_rewrite
          Assignee: bugs@httpd.apache.org
          Reporter: ikonta@yandex.ru

On a web-server, running apache2-2.2.24 I have a SSL-enabled vhost on
non-standard (3443) port.

Trying to force usage correct server-name I put in vhost's Directory section of
httpd-ssl.conf:
...
#
RewriteEngine on
#
RewriteCond %{HTTPS} ^on$
RewriteCond %{HTTP_HOST} !^admin\.mydomain\.ru$
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{SERVER_PORT} =3443
#
RewriteRule ^/?(.*) https://admin.mydomain.ru:%{SERVER_PORT}/$1 [L,R,NE]
#
...

and find redirect loop.

Updating Condifion including server port value in HTTP_HOST string made
redirect working, but I find it incorrect.

Operable redirect list is:
...
RewriteEngine on
#
RewriteCond %{HTTPS} ^on$
RewriteCond %{HTTP_HOST} !^admin\.mydomain\.ru:3443$
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{SERVER_PORT} =3443

RewriteRule ^/?(.*) https://admin.mydomain.ru:%{SERVER_PORT}/$1 [L,R,NE]
...

P.S. Also, at least for SSL-connection "Canonical Hostnames" section of
http://httpd.apache.org/docs/2.2/rewrite/remapping.html in description of
non-standard port usage case is incorrect.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 55029] Up to apache-2.2.24 mod_rewrite interpretes port suffix as a part of HTTP_HOST

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55029

Eric Covener <co...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from Eric Covener <co...@gmail.com> ---
HTTP_HOST is the value of the Host: header, so the port should be there when
used by the client.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org