Todd Walton wrote:
Does anybody have an opinion they'd like to share on redirecting
requests for "example.com" to "www.example.com"?  Is there some best
practices thing I'm not aware of?  Seems to me that it only makes
sense.


Our hosted web sites all contain DNS records such as the following:

$ORIGIN dreampark3d.net.
*                       A       12.184.45.99
mail                    A       12.184.45.101


Our Apache web server then has virtual host entries such as:

<VirtualHost ***.***.***.***:80>
ServerAdmin  [EMAIL PROTECTED]
DocumentRoot *******/dreampark3d.net
ServerName   dreampark3d.net



ServerAlias www.dreampark3d.net  d13271.u29.greenesthost.com


We can add additional names to ServerAlias if needed. The DNS record makes every domain name ending in dreampark3d.net, with the exception of mail.dreampark3d.net, resolve to the web server. Apache, listening on port 80, looks for an alias for <hostname>.dreampark3d.net. Anything listed in the ServerAlias line gets resolved to this virtual server. Any other host names end up returning a default Apache web page. dreampark3d.net also resolves to this virtual server.

(Note: The d13271.u29.greenesthost.com above is a temporary domain alias that is used while DNS records are updated by domain registrars so that people can get to their web sites and set them up before the records are updated/propagated.)

Another VirtualHost could be set up to serve up pages for other virtual hosts at dreampark3d.net. So, the above would act as a default for http://dreampark3d.net, and then I could have another with a "ServerAlias paul.dreampark3d.net" if I wanted a web site specific to me, and yet another if I wanted a site specific to David (ServerAlias david.dreampark3d.net).

PGA
--
Paul G. Allen, BSIT/SE
Network Administrator
Greenest Host
www.greenesthost.com


--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

Reply via email to