Re: Canonicalizing Domains / Hostnames

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It was thus said that the Great Michael B Allen once stated:
> 
> Hi Sean,
> 
> Ok. But I already have:
> 
> <VirtualHost *:80>
>   ServerName www.busicorp.com
>   ...
> </VirtualHost>
> 
> Can I have multiple VirtualHost sections with the same address (*:80)
> or expressions that overlap logically?

  Yes.  You'll need to add a NameVirtualHost directive before the
VirtualHost directives.  

NameVirtualHost *:80

<VirtualHost *:80>
  ServerName www.busicorp.com
  ...
</VirtualHost>

<VirtualHost *:80>
  ServerName server123.vps.hosting.net busicorp.com
  Redirect permanent	/ http://www.busicorp.com/
</VirtualHost>

  The NameVirtualHost directive tells Apache that there multiple sites
sharing the same IP address.  Apache will then use the information the
browser passes in (as part of the request) to determine which site to
reference (it's the "Host:" header the browser sends in).  If it's missing,
Apache will default to the first VirtualHost listed (so you want your
primary listed first---unless I'm mistaken, which I could be).

  -spc 



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux