[thelist] Losing the WWW

Matthew D. Fuller fullermd at over-yonder.net
Sun Mar 3 21:39:01 CST 2002


On Sun, Mar 03, 2002 at 12:15:04PM -0600 I heard the voice of
James S. Huggins (Evolt), and lo! it spake thus:
>
> If you enter www.jamesshuggins.com/aitcom
> you will go to http://jamesshuggins.com/aitcom/
>
> On the other hand, if you enter www.jamesshuggins.com/aitcom/
> you will go to http://www.jamesshuggins.com/aitcom/
>
> AITCOM, where I host my site, has indicated that all of their domains work
> this way. They have indicated that this removal of the "www" is a function
> of how the Apache servers are configured.

The reason for this is that, without the trailing slash, Apache sends
back a redirect.  It sends the redirect using the name it "thinks" is
right for the site (redirects are absolute URL's, not relative).

This is a function of the CanonicalName setting in Apache; in the
<VirtualHost> definition, the shorter form is listed as the 'main'
servername.  If CanonicalName is set to yes, then any self-referencing
URL Apache creates will use the name it thinks is the server's name; with
it set to no, it uses the servername the client set.

This is especially important with a place doing name-based vhosting.  I
can only assume your host is IP-based, or you'd have big troubles.  If
the host is websrv7.hosting.com, and your site is mysite.com, and it's
name-based, Apache will use websrv7.hosting.com for self-referring URL's
if CanonicalName is on, since that's (as far as its concerned) the
canonical name.



--
Matthew Fuller     (MF4839)     |    fullermd at over-yonder.net
Unix Systems Administrator      |    fullermd at futuresouth.com
Specializing in FreeBSD         |    http://www.over-yonder.net/

"The only reason I'm burning my candle at both ends, is because I
      haven't figured out how to light the middle yet"



More information about the thelist mailing list