Mirror dynamic website on other domain

Posted by ouray, 02-19-2010, 07:51 PM
Does anyone know of a way to mirror a website on another domain? My client is using ExpressionEngine to manage multiple websites within the same hosting account. He now wants to have a website on a different hosting account, but with content from the same ExpressionEngine installation so that he can manage it all in one place. I have thought of having a script on the second account fetch pages (with file_get_contents or curl) from the first account. The website on the first account would only be used to serve pages to the other. I tried this and it works pretty well, but my client also wants users to be able to post comments on the mirrored website and have them be posted in the database on the other server. We could have the forms post to the original domain and then redirect back to the mirrored site after the comment was posted, but my client doesn't want any links from domain 2 to domain 1. I don't know if this is even possible. Is there any software to do this, to mirror / proxy a site on another domain? Both accounts run on Linux btw. Thank you.

Posted by mattle, 02-20-2010, 11:45 AM
Your best bet is to just hook both software installations to the same DB. Even in master/master replication, it's not recommended to write to both masters. Unless you need a failover db, however, I'd just use the one.

Posted by ouray, 02-21-2010, 11:16 PM
Thank you mattle. We may give this a try, although ExpressionEngine doesn't recommended to have two installs use the same database.

Posted by foobic, 02-21-2010, 11:55 PM
Ugh. So the aim of this is not to create redundancy but to deliberately duplicate content on two different websites? If so, search out some SEO experts' opinions on duplicate content and see if you can convince the client to change his mind... But if you must do it, I'd suggest using a proxy approach with the less-visited site simply fetching pages from the main install. Have a look at mod_proxy for Apache or some of the cgi / PHP proxy scripts. You can proxy the comments page too so that comments submitted to either site get back to the main install. I don't know EE specifically but I suspect that using a shared database (whether replicated or a shared single db) is likely to give you problems. Other CMSs often have config data including the domain name stored in the database, and even if EE doesn't, it's hard to keep absolute links out of the content.

Posted by ouray, 03-05-2010, 04:37 PM
Thank you foobic! I got it to work by including the following lines:

Was this answer helpful?

 Print this Article

Also Read

frequent rebooting - what can cause this?

Posted by Premier, 07-14-2007, 12:28 AMI have a server that is monitored with a system that...

Urgent problem: too much traffic, how to stop it?

Posted by fgalli, 05-04-2007, 09:33 AMHi, i've a vps with iptables, but i've too much traffic...

problem with named

Posted by mohamed200, 09-15-2008, 12:46 PMhello , i have some problem with named when i moved...

Any way to stop spammers from forging the "From" or "Reply To" fields?

Posted by mifbody, 03-28-2008, 07:21 PMHey guys, Is there any possible way to stop spammers from...

New PHP Exploit

Posted by jon-f, 09-11-2007, 06:27 PMcheck this out...