Majority of the things can be shared, but the one thing that would need to be different because of the differing domain names would be some of the entries in the Options table.
Your best bet would be probably to modify WP lightly to grab the Posts/Comments from the same location while keeping different tables for other site-specific things.
Regards
Here’s what I’d recommend (only works if the tables for both blogs are in the same database):
First, choose which blog acts as primary, that is the blog the other will “slave” off of for posts and whatnot.
Next, decide which elements the secondary blog will access on the primary. You’ll want posts and categories to be the same, but how about users? Or links?
Finally, edit the secondary blog’s wp-settings.php (in the blog’s root). Look in it for this section:
// Table names
$wpdb->posts = $table_prefix . 'posts';
$wpdb->users = $table_prefix . 'users';
$wpdb->categories = $table_prefix . 'categories';
$wpdb->post2cat = $table_prefix . 'post2cat';
$wpdb->comments = $table_prefix . 'comments';
$wpdb->links = $table_prefix . 'links';
$wpdb->linkcategories = $table_prefix . 'linkcategories';
$wpdb->options = $table_prefix . 'options';
$wpdb->postmeta = $table_prefix . 'postmeta';
Assuming the primary blog’s table prefix is wp_, for each table shared between the blogs change $table_prefix to 'wp_', like so:
// Table names
$wpdb->posts = 'wp_posts';
$wpdb->users = $table_prefix . 'users';
$wpdb->categories = 'wp_categories';
$wpdb->post2cat = 'wp_post2cat';
$wpdb->comments = 'wp_comments';
$wpdb->links = $table_prefix . 'links';
$wpdb->linkcategories = $table_prefix . 'linkcategories';
$wpdb->options = $table_prefix . 'options';
$wpdb->postmeta = 'wp_postmeta';
Note I’ve modified just those above that are required to keep posts “mirrored” on both blogs. The other tables are up to you. At minimum keep $wpdb->options as is, to retain the settings for the blog (including blog name, permalinks, and so on).
Doing it this way will require keeping this file–or at least the changes–untouched during upgrades to your WordPress installation. Keep that in mind.
Couldn’t you save yourself a lot of work and simply redirect one of the sites to the other?
Shadow: As I mentioned initially, I want to track which site users are using. Further, for mostly political reasons, I don’t want the user to choose to go to danalovesariel and have it redirect them to ariellovesdana as that message might be something about dominance. Silly, I know, but for anyone who has gone through the pre-marriage and marriage games, they know how much such little ripples can rock the boat.
To the rest: Thanks for the ideas. I’ll give them a go and let you know how they turn out. Thanks for the help!
Looks like it worked… Thanks again for all your help!
Looks like you sorted it out, but can you not simply look at the server stats and look at entry page? You could then track which domain was hit more, even with a redirect.
miklb – you’re right… I absolutely could… but I’d still worry that some family member or friend or something would see the domain changing in the address bar and take it the wrong way. This is just easier than having to explain. *GRIN*