httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christoph Anton Mitterer <>
Subject [users@httpd] cleanest/fastest way of redirecting aliases to canonical server names
Date Sat, 29 Jan 2011 01:38:54 GMT

I'm having a vhost, which is reachable via one canonical name, e.g., and also via several aliases, e.g.,, etc.

I want that whenever requests are made via one of the aliases, that
those are redirected to the canonical name.

IMHO there are about the following two ways:
- one vhost, which has the canonical name as ServerName, and the aliases
as ServerAliases
- and also has some RewriteCond+RewriteRules, making a redirect to the
canonical address if HTTP_HOST is one of the aliases.

- two vhosts, the first having only the canonical name as ServerName (no

- the second, having the aliases as ServerName/ServerAliases
- and also doing a Redirect /

Can (2) be handled with more performance by Apache than (1) (as it
doesn't have to evaluate the RewriteConds and the regexps every time?

At least (1) seems to be cleaner readable to me (from a config file
point of view)


View raw message