[NTLUG:Discuss] Apache redirect....doesn't
Bug Hunter
bughuntr at one.ctelcom.net
Tue Mar 5 13:15:06 CST 2002
I understand. I've had same problems. Try the following:
> <VirtualHost 192.168.0.1>
> ServerAdmin webmaster at domainname.com
> DocumentRoot /home/domainname/public_html
> ServerName www.domainname.com
> ErrorLog /var/log/domainname-error_log
> CustomLog /var/log/domainname-access_log common
> </VirtualHost>
> <VirtualHost 192.168.0.1>
> ServerAdmin webmaster at domainname.com
> DocumentRoot /home/domainname/public_html
> ServerName domainname.com
> ErrorLog /var/log/domainname-error_log
> CustomLog /var/log/domainname-access_log common
> </VirtualHost>
That is what virtual host is good for. :) It does exactly what you
want.
bug
On Tue, 5 Mar 2002, Richard Geoffrion wrote:
> Can anyone point out what I may be doing incorrectly in trying to redirect
> URL1 to URL2?
>
> Here is what I have in my web server configuration. According to all of the
> documentation I've read, http://domainname.com SHOULD redirect to
> http://www.domainname.com. What is currently happening is that ANY virtual
> web site that is addressed without the 'www.' prefix to the domain name is
> being sent to the default web site directory.
>
> [snip]
>
> <VirtualHost 192.168.0.1>
> Redirect http://domainname.com http://www.domainname.com
> ServerAdmin webmaster at domainname.com
> DocumentRoot /home/domainname/public_html
> ServerName www.domainname.com
> ErrorLog /var/log/domainname-error_log
> CustomLog /var/log/domainname-access_log common
> </VirtualHost>
> [/snip]
>
> I've tried..
>
> Redirect domainname.com http://www.domainname.com
> and
> Redirect / http://www.domainname.com
>
> ...to no avail.
>
> UG! Any suggestions?
>
> -Richard
>
>
>
> _______________________________________________
> http://www.ntlug.org/mailman/listinfo/discuss
>
More information about the Discuss
mailing list