Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

i have a problem with 2 websites. I have for example

site1.com

site2.com

How can i make a perfect clone of site1.com for site2.com? i mean i want a method that i can do this in minutes, not changing the database, delete it, create it once more, copy ... etc

The clone must be exacly the same, except the domain,mysql, files including folders, images, comments, everything.

share|improve this question
    
Do you want duplicate files or just to display the same site on two different domains? –  Brian Fegter Sep 25 '12 at 15:33
    
thanks for answer, different domains, but the content is the same –  Empeus Sep 27 '12 at 8:19
add comment

1 Answer 1

Caveat

This is extremely bad for SEO. Having duplicate content can ultimately cause your site(s) to be removed from search results.

Solution

This is actually pretty simple to have one database and disk content. Point both of the docroots to the same directory. Make sure each server name in your Apache config for each domain matches your domain name. Add this to your wp-config.php file:

define('WP_HOME', 'http://' . $_SERVER['SERVER_NAME']); # no trailing slash
define('WP_SITEURL', 'http://' . $_SERVER['SERVER_NAME']); # no trailing slash

Content URLs (images, media, etc...) will be sourced from the original domain, but will still work. Posting media on either domain will create a mix-match of URLs for guid and post_content. If you disable one domain, you would then need to find/replace all of those URLs in the database to keep them working properly. Do not hardcode JavaScript includes. Use wp_enqueue_script and wp_register_script so that you don't run into XSS errors.

Again, this is not a good practice, but WordPress is flexible enough to accomplish what you want.

share|improve this answer
    
how about just export articles from site1.com and import it on site2.com? wouldn't that work smooth? –  Empeus Oct 1 '12 at 10:16
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.