Kirk Cerny wrote:
I always account for the people that are going to type the www. with
an apache ServerAlias
ServerAlias www.test.somedomain.com
yes, but the point of www was to differentiate which server has mail,
which has web, etc. www, when used, should be just one subdomain.
Nobody should have to define www in front of every subdomain. This
would also mean that if your hosting provider gives you 50 sub-domains,
you really only get 25 if you define a www in front of every subdomain
in addition to the subdomain. Then there's paying for digital
certificates... if you use ServerAlias for www on every single
subdomain, you will get errors for all users who try to access your
domain without www if you paid for a cert with www or vise versa. Who
wants to pay double certification costs to avoid the error (buy a cert
for www and not www)? I'd rather do this than define a www ServerAlias
for all domains and subdomains:
<VirtualHost [IP]:[port]>
ServerName www.[domain].org
RedirectPermanent / http://[domain].org/
</VirtualHost>
Or this for a subdomain:
<VirtualHost [IP]:[port]>
ServerName www.[sub].[domain].org
RedirectPermanent / http://[sub].[domain].org/
</VirtualHost>
This yields several advantages over ServerAlias:
* Whenever someone requests the unnecessary www.[domain].org , the URL
in their browser changes to the URL without www.
* Keen surfers will notice this and stop using the www, thus promoting
the do-away-with-www philosophy I share with Wade.
* I only need one digital certificate for the domain, without www.
* SEO - this tells search engines that this domain redirects, and that
the redirect is permanent.
FYI, you can also use RedirectPermanent to make all your traffic use SSL:
<VirtualHost [IP]:80>
ServerName [domain].org
RedirectPermanent / https://[domain].org/
</VirtualHost>
Brandon Stout
http://mscis.org
_______________________________________________
UPHPU mailing list
[email protected]
http://uphpu.org/mailman/listinfo/uphpu
IRC: #uphpu on irc.freenode.net