[lug] Strange Apache VirtualHost behavior

Lee Woodworth blug-mail at duboulder.com
Mon Nov 22 23:24:15 MST 2004


You fixed it? I just looked at
     http://david.morris-clan.net/foo (no trailing slash)
and it redirects to
     http://david.morris-clan.net/foo/
which has cats.html in it.

David Morris wrote:
> On Mon, Nov 22, 2004 at 02:54:06PM -0700, David Anselmi wrote:
> 
>>>If I go to this one:
>>>
>>>   http://david.morris-clan.net/foo
>>>
>>>(Note the lack of a trailing '/') I get redirected here:
>>>
>>>   http://belsambar.morris-clan.net/foo/
>>
>>No trailing slash gives me a 404 at the moment.  Perhaps you want mod_dir?
> 
> 
> Aye, you get 404 because
> http://belsambar.morris-clan.net/foo/ does not exist.  If
> you add the trailing '/' you stay in http://david.mo... and
> don't get 404.  I do have mod_dir being used.
> 
> 
>>[...]
>>
>>>NameVirtualHost 66.93.122.13
>>>
>>><VirtualHost 66.93.122.13:80>
>>>	ServerAlias		morris-clan.net
>>>	ServerAlias		*.morris-clan.net
>>
>>Should the first of those be ServerName rather than Alias by any chance?
> 
> 
> It should yes....but doesn't change anything apparently
> 
> A few more experiments make it even more interesting:
> 
> No matter what virtual host is placed first, the hostname in
> the URL is redirected to 'belsambar.morris-clan.net' (the
> name of the computer which, incidentally, doesn't exist
> anywhere in the config file) and the DocumentRoot is taken
> from the first VirtualHost entry.
> 
> --David
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> Join us on IRC: lug.boulder.co.us port=6667 channel=#colug




More information about the LUG mailing list