[CentOS] www.mydomain.org and mydomain.org should resolve to the same IP

Sun Jul 31 01:47:20 UTC 2011
Cliff Pratt <enkiduonthenet at gmail.com>

On Sun, Jul 31, 2011 at 1:42 PM, Always Learning <centos at u6.u22.net> wrote:
>
> On Sat, 2011-07-30 at 16:49 -0700, John R Pierce wrote:
>
>
>> <VirtualHost  207.111.214.244>
>>          ServerName astronomy.santa-cruz.ca.us
>>          DocumentRoot /..../html
>>          ErrorLog /...../logs/error_log
>>          CustomLog /..../logs/access_log common
>> </VirtualHost>
>>
>> <VirtualHost 207.111.214.244>
>>          ServerName astro.santa-cruz.ca.us
>>          ServerAlias www.astronomy.santa-cruz.ca.us
>> www.astro.santa-cruz.ca.us
>>          RedirectMatch permanent /(.*) http://astronomy.santa-cruz.ca.us/$1
>> </VirtualHost>
>
>
> You can amalgamate that into a single entry .....
>
> <VirtualHost astronomy.santa-cruz.ca.us:80 \
>             www.astronomy.santa-cruz.ca.us:80 \
>             astro.santa-cruz.ca.us:80 \
>             www.astro.santa-cruz.ca.us:80>
>    DocumentRoot /data/web/astronomy
>    ServerName astronomy.santa-cruz.ca.us
>    CustomLog /data/logs/acc.astronomy combined
>    ErrorLog  /data/logs/err.astronomy
>    DirectoryIndex main.php
>    HostnameLookups Off
> </VirtualHost>
>
Or use ServerAlias (not tested).

Cheers,

Cliff