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

Sun Jul 31 02:50:59 UTC 2011
Cliff Pratt <enkiduonthenet at gmail.com>

On Sun, Jul 31, 2011 at 2:39 PM, John R Pierce <pierce at hogranch.com> wrote:
> On 07/30/11 6:42 PM, Always Learning wrote:
>> You can amalgamate that into a single entry .....
>
> that doesn't do the redirect.  I *want* it so that if you go to any of
> these URLs...
>
>     http://astro.santa-cruz.ca.us
>     http://www.astro.santa-cruz.ca.us
>     http://www.astronomy.santa-cruz.ca.us
>
> you get redirected to
>     http://astronomy.santa-cruz.ca.us
>
> try it, you'll see how that works.
>
Yeah, I was suggesting something like this:

<VirtualHost  207.111.214.244>
          ServerName astronomy.santa-cruz.ca.us
          ServerAlias astro.santa-cruz.ca.us
          ServerAlias www.astronomy.santa-cruz.ca.us
          ServerAlias www.astro.santa-cruz.ca.us

          DocumentRoot /..../html
          ErrorLog /...../logs/error_log
          CustomLog /..../logs/access_log common
</VirtualHost>

or

<VirtualHost  207.111.214.244>
          ServerName astronomy.santa-cruz.ca.us
          # All aliases on one long line
          ServerAlias astro.santa-cruz.ca.us
www.astronomy.santa-cruz.ca.us  www.astro.santa-cruz.ca.us

          DocumentRoot /..../html
          ErrorLog /...../logs/error_log
          CustomLog /..../logs/access_log common
</VirtualHost>

I *think* the first example works, but I'd have to check the configs
to be sure and I don't have access from here.

However, if it works for you, it works, and all else is quibbles.

Cheers,

Cliff