httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
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
https://issues.apache.org/bugzilla/show_bug.cgi?id=47332

           Summary: [mod_rewrite] SERVER_NAME env var should be the vhost
                    server_name
           Product: Apache httpd-2
           Version: 2.3-HEAD
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: All
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: nicolas_froidure@elitwork.com


Most used of the url rewriting rule is a redirection to the SERVER_NAME
(elitwork.com to www.elitwork.com 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: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


Mime
View raw message