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' ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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 |
|
|||
|
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." |
|
|||
|
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 |
|
|||
|
"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 |
|
|||
|
"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 | |
|
|