httpd-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 47332] [mod_rewrite] SERVER_NAME env var should be the vhost server_name
Date Fri, 05 Nov 2010 09:00:00 GMT

--- Comment #4 from Nicolas F. <> 2010-11-05 04:59:57 EDT

I'll try to be more clear.

Each time i create a vhost, i must put the following rewrite rules inside :
RewriteCond %{HTTP_HOST} !
RewriteRule (.*)$1 [R=301,L]

By this way, i ensure the client use the default domain instead of an alias
(like I do it systematically to avoid duplicate content in my

As i define a ServerName and a ServerAlias value, i thought the SERVER_NAME
 global variable was filled with the ServerName value done in the vhost config.

But it's not the case. It give the value of the ServerName OR the ServerAlias.
So i can't write a generic rule for each vhost of my httpd.conf file.

If i could, there will be two major advantages for me (and probably many
others) :
- currently, it would save 200 lines (50vhost * 2 lines) in my httpd.conf (in
fact, i choose to use the .htaacess for readability, but performances are
affected by it).

That's why i suggested an enhancement : fill SERVER_NAME with the ServerName
value defined in the vhost, or, create a DEFAULT_SERVER_NAME variable to allow
us to create generic rewriting rules.

I assume the fact my first request was not clear and i apologize for it.

Thank you.

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