httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 47332] New: [mod_rewrite] SERVER_NAME env var should be the vhost server_name
Date Mon, 08 Jun 2009 11:43:45 GMT

           Summary: [mod_rewrite] SERVER_NAME env var should be the vhost
           Product: Apache httpd-2
           Version: 2.3-HEAD
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: All

Most used of the url rewriting rule is a redirection to the SERVER_NAME
( to by example).

Most of the time, the url to redirect to is also the servername given in the
httpd.conf file.

The problem is that the env var SERVER_NAME in the mod_rewrite is corresponding
to the domain name used in the request, so SERVER_NAME can also be an
server_alias defined in the virtualhost.

The problem is that it impeach apache user to define a global rule to be sure
that a user using a server_alias will be redirected to the server_name domain.

i.e, this doesn't work : 

RewriteCond %{HTTP_HOST} !%{SERVER_NAME}
RewriteRule (.*) %{SERVER_NAME}/$1 [R=301,L]

I don't know if it is the right place but my english is poor and it's already a
miracle if you understand what i wrote here ;)

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

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message