'www' prefix

This is a discussion on 'www' prefix within the Apache Web Server forums, part of the Web Server and Related Forums category; Hi all, For some reason, I have to create two VirtualHost configurations in order to cover those who include 'www' ...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-05-2004
Max
 
Posts: n/a
Default 'www' prefix

Hi all,

For some reason, I have to create two VirtualHost configurations in
order to cover those who include 'www' and those who don't. Here is my
configuration for a domain name:

<VirtualHost 66.199.183.31:80>
User orgelcomm
Group users
ServerName elcommunity.org
Setenv VLOG /home/orgelcomm/logs
DocumentRoot /home/orgelcomm/public_html
</VirtualHost>

<VirtualHost 66.199.183.31:80>
User orgelcomm
Group users
ServerName www.elcommunity.org
Setenv VLOG /home/orgelcomm/logs
DocumentRoot /home/orgelcomm/public_html
</VirtualHost>

Is it possible to make these two into one? I tried using wildcards and
so on, and haven't been able to find anything in the docs to help me.

Apache signature:

Server Version: Apache/1.3.31 (Unix) (Gentoo/Linux) mod_ssl/2.8.19
OpenSSL/0.9.7d PHP/4.3.8
Server Built: Aug 24 2004 17:31:47

Any suggestions?

Thanks,
Max
  #2 (permalink)  
Old 11-05-2004
Davide Bianchi
 
Posts: n/a
Default Re: 'www' prefix

On 2004-11-05, Max <mno2go@gmail.com> wrote:
> For some reason, I have to create two VirtualHost configurations in
> order to cover those who include 'www' and those who don't.
> Is it possible to make these two into one?


Yes, see the documentation related to ServerAlias.
Davide

--
"A copy of Windows 95 and 4x4 MB of SIMMs, please."
  #3 (permalink)  
Old 11-05-2004
Stephen S
 
Posts: n/a
Default Re: 'www' prefix

to Max I now respond:

Very simple.

<VirtualHost 66.199.183.31:80>
User orgelcomm
Group users
ServerName elcommunity.org
ServerAlias www.elcommunity.org
Setenv VLOG /home/orgelcomm/logs
DocumentRoot /home/orgelcomm/public_html
</VirtualHost>

--
Stephen S.
-------------------------

> Hi all,
>
> For some reason, I have to create two VirtualHost configurations in
> order to cover those who include 'www' and those who don't. Here is my
> configuration for a domain name:
>
> <VirtualHost 66.199.183.31:80>
> User orgelcomm
> Group users
> ServerName elcommunity.org
> Setenv VLOG /home/orgelcomm/logs
> DocumentRoot /home/orgelcomm/public_html
> </VirtualHost>
>
> <VirtualHost 66.199.183.31:80>
> User orgelcomm
> Group users
> ServerName www.elcommunity.org
> Setenv VLOG /home/orgelcomm/logs
> DocumentRoot /home/orgelcomm/public_html
> </VirtualHost>
>
> Is it possible to make these two into one? I tried using wildcards and
> so on, and haven't been able to find anything in the docs to help me.
>
> Apache signature:
>
> Server Version: Apache/1.3.31 (Unix) (Gentoo/Linux) mod_ssl/2.8.19
> OpenSSL/0.9.7d PHP/4.3.8
> Server Built: Aug 24 2004 17:31:47
>
> Any suggestions?
>
> Thanks,
> Max




  #4 (permalink)  
Old 11-05-2004
HansH
 
Posts: n/a
Default Re: 'www' prefix

"Stephen S" <not@home.nope> schreef in bericht
news:CLIid.48293$_g6.15952@okepread03...
> > For some reason, I have to create two VirtualHost configurations in
> > order to cover those who include 'www' and those who don't. Here is my
> > configuration for a domain name:
> > Is it possible to make these two into one? I tried using wildcards and
> > so on, and haven't been able to find anything in the docs to help me.

> Very simple.
> ServerAlias www.elcommunity.org

If you are using cookies, be aware visitors alternating between
www.elcommunity.org and elcommunity.org may run into trouble. Either make
cookies for the domain elcommunity.org or rewrite their URL to always have
www upfront.

HansH


  #5 (permalink)  
Old 11-08-2004
Max
 
Posts: n/a
Default Re: 'www' prefix

"HansH" <hans@niet.op.het.net> wrote in message news:<cmgfe8$29l$1@news.cistron.nl>...
> "Stephen S" <not@home.nope> schreef in bericht
> news:CLIid.48293$_g6.15952@okepread03...
> > > For some reason, I have to create two VirtualHost configurations in
> > > order to cover those who include 'www' and those who don't. Here is my
> > > configuration for a domain name:
> > > Is it possible to make these two into one? I tried using wildcards and
> > > so on, and haven't been able to find anything in the docs to help me.

> > Very simple.
> > ServerAlias www.elcommunity.org

> If you are using cookies, be aware visitors alternating between
> www.elcommunity.org and elcommunity.org may run into trouble. Either make
> cookies for the domain elcommunity.org or rewrite their URL to always have
> www upfront.
>
> HansH


Hi Stephen and Hans,

Thanks a lot for your help!

Best,
Max
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 02:09 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0