cleanest/fastest way of redirecting aliases to canonical server names

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]




Hi.

I'm having a vhost, which is reachable via one canonical name, e.g.
example.org, and also via several aliases, e.g. www.example.org,
example.com, 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:
1)
- 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.


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

- the second, having the aliases as ServerName/ServerAliases
- and also doing a Redirect / http://example.org



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)


Cheers,
Chris.

Attachment: smime.p7s
Description: S/MIME cryptographic signature


[Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Photo]     [Yosemite Photos]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]


Add to Google Powered by Linux