[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cobalt-users] Multiple domains transparently pointing to a single site
- Subject: Re: [cobalt-users] Multiple domains transparently pointing to a single site
- From: "Clint Decker" <nim1998@xxxxxxx>
- Date: Wed Nov 1 14:41:03 2000
- List-id: Mailing list for users to share thoughts on Cobalt products. <cobalt-users.list.cobalt.com>
I do this all the time.
Add each site in the admin section as if they were all different sites.
Then edit your httpd.conf file so each domain points to the same folder.
Something like this: (scroll down, there is more below)
<VirtualHost 123.456.789.10>
ServerName www.a.com
ServerAdmin admin
DocumentRoot /home/sites/site100/web
ServerAlias a.com
RewriteEngine on
RewriteCond %{HTTP_HOST} !^123.456.789.10(:80)?$
RewriteCond %{HTTP_HOST} !^www.a.com(:80)?$
RewriteRule ^/(.*) http://www.a.com/$1 [L,R]
RewriteOptions inherit
AliasMatch ^/~([^/]+)(/(.*))? /home/sites/site100/users/$1/web/$3
AliasMatch ^/users/([^/]+)(/(.*))? /home/sites/site100/users/$1/web/$3
AddHandler cgi-wrapper .cgi
AddHandler cgi-wrapper .pl
AddHandler server-parsed .shtml
AddType text/html .shtml
</VirtualHost>
<VirtualHost 123.456.789.11>
ServerName www.b.com
ServerAdmin admin
DocumentRoot /home/sites/site100/web
ServerAlias a.com
RewriteEngine on
RewriteCond %{HTTP_HOST} !^123.456.789.11(:80)?$
RewriteCond %{HTTP_HOST} !^www.b.com(:80)?$
RewriteRule ^/(.*) http://www.b.com/$1 [L,R]
RewriteOptions inherit
AliasMatch ^/~([^/]+)(/(.*))? /home/sites/site100/users/$1/web/$3
AliasMatch ^/users/([^/]+)(/(.*))? /home/sites/site100/users/$1/web/$3
AddHandler cgi-wrapper .cgi
AddHandler cgi-wrapper .pl
AddHandler server-parsed .shtml
AddType text/html .shtml
</VirtualHost>
All you need to do is change the folder that the domain looks for to grab
the files. Change them all the the same number.
This way.. when someone types in the domain name into the URL, the server
will not rewrite the address because the server thinks thats the only domain
pointing to that folder. It wont rewrite itself.
You might want to also change the sybmolic link in the /home/sites/ folder
to point to the right directory. So if you double click www.b.com it goes to
the www.a.com folder.
To change the symbolic link, first remove the old link.
rm -R www.b.com
ln -s /home/sites/site100/ www.b.com
Let me know if you have problems or dont understand what im talking about.
Clint