Jay,
Without touching your configuration files, I would say to setup a symlink. ie /home/sites/site1/web -- www.domain.com /home/sites/site2/web -- www.domain.com.uk now, using a symlink cd /home/sites/site2 rmdir web ln -s /home/sites/site1/web /home/sites/site2/web There you can keep your original .uk and do NOT need to rewrite anything! Brian Smith CCNA, NCSA Network Support Engineer SOLUSERVE www.solunet.com 1571 Robert J. Conlan Blvd., Suite 110 Palm Bay, FL 32905 (888)449-5766 fax: (321)-308-7986 -----Original Message----- From: Jay Nelson [mailto:[EMAIL PROTECTED]] Sent: Friday, March 08, 2002 5:35 PM To: [EMAIL PROTECTED] Subject: [cobalt-developers] Dynamically mirroring website I am running a RaQ3 with multiple virtual domains hosted on a single IP address. I am trying to get two domains to be identical, without rewriting the hostname URL. User requests http://www.domain.com/foo.html or user requests http://www.domain.co.uk/foo.html I want both requests to return the exact same page from my webserver (both domain names are hosted on the same box and IP address). Also I want the clicks on all relative links to maintain the original hostname that they were requested from (e.g., the UK user thinks they are still in the UK as they click around the website). I think the right answer is mod_rewrite rules using internal proxy, but I gave server alias a whirl too. 1) Using ServerAlias gets the first page, but then the host name changes if you click on anything: <VirtualHost aa.bb.cc.dd> ServerName www.domain.co.uk ServerAlias www.domain.com ... </VirtualHost> 2) I tried to use proxy but I can't get it to work. I uncommented the line ProxyRequests on and then did the following: <VirtualHost aa.bb.cc.dd> ServerName www.domain.co.uk RewriteEngine on RewriteCond %{HTTP_HOST} !^aa.bb.cc.dd(:80)?$ RewriteCond %{HTTP_HOST} !^www.domain.co.uk(:80)?$ RewriteRule ^/(.*) http://www.domain.com/$1 [P] The [P] flag is supposed to make it use the internal proxy and redirect to the external domain without modifying the URL. Any ideas on how to make this work? 3) I tried the lame idea of just mapping my root directories (which of course won't work when I use multiple machines), but for some reason the httpd thinks that the first virtual domain takes precedence, gives me a warning and never sets up properly: <VirtualHost aa.bb.cc.dd> ServerName www.domain.co.uk # DocumentRoot /home/sites/site7/web DocumentRoot /home/sites/home/web RewriteEngine on RewriteCond %{HTTP_HOST} !^aa.bb.cc.dd(:80)?$ RewriteCond %{HTTP_HOST} !^www.domain.co.uk(:80)?$ RewriteRule ^/(.*) http://www.domain.co.uk/$1 [L,R] RewriteOptions inherit # AliasMatch ^/~([^/]+)(/(.*))? /home/sites/site7/users/$1/web/$3 # AliasMatch ^/users/([^/]+)(/(.*))? /home/sites/site7/users/$1/web/$3 AliasMatch ^/~([^/]+)(/(.*))? /home/sites/home/users/$1/web/$3 AliasMatch ^/users/([^/]+)(/(.*))? /home/sites/home/users/$1/web/$3 </VirtualHost> Note that I used the RaQ control panel to create the domain and it assigned site7. Here I unceremoniously ignore that and have it refer to the other domain. Here is the message I get (I have SSL turned on): [warn] VirtualHost aa.bb.cc.dd:443 overlaps with VirtualHost aa.bb.cc.dd:443, the first has precedence, perhaps you need a NameVirtualHost directive Note that none of the automatically generated Cobalt sites have a NameVirtualHost directive. After starting with the above, none of my websites are accessible, and besides this solution would never work across multiple machines. I think #2 is the right approach, or is it not? If so, has anyone gotten this to work? jay --------------------------------------------------- DuoMark International, Inc. 6523 Colgate Avenue, Suite 325 Los Angeles, CA 90048-4410 / USA Voice: +1 323 381-0001 FAX: +1 323 549 0172 Email: [EMAIL PROTECTED] WWW: http://www.duomark.com/ _______________________________________________ cobalt-developers mailing list [EMAIL PROTECTED] http://list.cobalt.com/mailman/listinfo/cobalt-developers _______________________________________________ cobalt-developers mailing list [EMAIL PROTECTED] http://list.cobalt.com/mailman/listinfo/cobalt-developers