httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Andersson" <rob...@profundis.nu>
Subject Re: [users@httpd] Wildcards in Name-based Virtual Hosts
Date Thu, 17 Jun 2004 09:11:53 GMT
James Tusini wrote:
> I just want to make sure that both http://www.mydomain.com and
> http://mydomain.com is handled by the same VirtualHost.

I always recommend redirecting to the "correct" hostname. To only have a
single canonical hostname for your site's contents, is good for many
reasons.

What I have for each of my VHosts:

    <VirtualHost *>
        ServerName  www.domain.tld
        # other stuff for the real host
    </VirtualHost>

    <VirtualHost *>
        ServerName domain.tld
        ServerAlias *.domain.tld
        RedirectPermanent / http://www.domain.tld/
    </VirtualHost>

You could achieve the same effect in other ways, but this is clear and
simple.

Regards,
Robert Andersson


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message