Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] Multiple Domains - Apache
- Date: Wed, 30 Apr 2008 23:20:47 +0900
- From: tlug@example.com
- Subject: Re: [tlug] Multiple Domains - Apache
- References: <5d4da3b88ceb2ef7d5735c55eed18ba9@localhost.localdomain>
- User-agent: KMail/1.9.6 (enterprise 0.20070907.709405)
On Tuesday 29 April 2008 08:34:51 Deepan wrote: > I am serving two domains from the same machine > using Apache. I want www to be used in both of the > domains, hence I redirect urls without www to > appropriate urls with www. I would suggest using Redirect instead of RewriteEngine. For example: <VirtualHost *:80> ServerName www.domaina.com ServerAdmin webmaster@example.com DocumentRoot /var/www/domaina/ <Directory /var/www/domaina/> Options FollowSymLinks AllowOverride None Order Allow,Deny Allow from All </Directory> ErrorLog /var/log/apache2/domaina.error.log LogLevel warn CustomLog /var/log/apache2/domaina.access.log combined </VirtualHost> <VirtualHost *:80> ServerName domaina.com Redirect permanent / http://www.domaina.com/ </VirtualHost> Then make a copy for the second domain. With your cursor on the last line in vi: :1,.y p :.,$s/domaina/domainb/ Some people have suggested the use of ServerAlias. Note, however, that this causes the same content to be served for both addresses, not a redirect, which is what you said that you want (and is usually a better practice). If you had a .org domain that you wanted to redirect as well, though, then ServerAlias would be used. The second VirtualHost above would become the following: <VirtualHost *:80> ServerName domaina.com ServerAlias www.domaina.org ServerAlias domaina.org Redirect permanent / http://www.domaina.com/ </VirtualHost> Hope this helps, Travis
- References:
- [tlug] Multiple Domains - Apache
- From: Deepan
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] [OT] Pre-Flextime & Automatic Ticket Gates
- Next by Date: Re: [tlug] Bill Gates and the GPL , let the flames begin
- Previous by thread: Re: [tlug] Multiple Domains - Apache
- Next by thread: [tlug] Chocolates for Stephen
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links