WordPress.org

Ready to get started?Download WordPress

Forums

WordPress MU Domain Mapping
Is there a way to map additional domains to Site ID 1 ? (12 posts)

  1. gh0zt
    Member
    Posted 2 years ago #

    I don't see any way to add additional mappings to the first primary ID=1 site, is there any way to do this?

    http://wordpress.org/extend/plugins/wordpress-mu-domain-mapping/

  2. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 2 years ago #

    is there any way to do this?

    No, the plugin doesn't allow you to map the main site.

  3. awtx
    Member
    Posted 2 years ago #

    Whether it is for the primary domains or additional network sites, you are parking additional domains on the primary domain.

    If you want the additional domain(s) to deliver the visitor to the primary site there would be no need to try to map the domains. The browser would be automatically redirected to the primary site if the parked domains are not mapped to network sites.

  4. gh0zt
    Member
    Posted 2 years ago #

    It redirects them to a login. Doesn't behave like primary domain.

  5. Andrew Tegenkamp
    Member
    Posted 2 years ago #

    We've run into this in development when we can't really mess with DNS and I've been able to add the domain and point it to site ID #2 and then go into the database and manually change the wp_domain_mapping table, and it has always worked out pretty well. I can't recommend or attest to it on live, and it does not let you edit them in the admin interface, but we haven't seen any ill effects yet to doing this while developing so our hosts file works out ok.

  6. Nick Davis
    Member
    Posted 2 years ago #

    Hi guys

    re: not being able to map to site ID #1

    I take it this plugin wouldn't work then if I am trying to redirect all non-www traffic from the main domain on a multisite setup, eg example.com to http://www.example.com then?

    I set up the multisite install with the cleaner example.com so I could get the nicer site1.example.com and site2.example.com sub-site URLs (rather than site1.www.example.com) however I now only want to use http://www.example.com for the main URL

    I have installed the plugin and tried Andrew's table hack but that didn't fix it and also spent (several hours) trying .htaccess hacks (all ended in infinite redirect loops) as well.

    This might not sound like a big deal (and normally I wouldn't be bothered) but I really need it for this site. I just want example.com/whatever to always redirect to http://www.example.com/whatever (without affecting the sub-sites) but I just can't do it :(

    Really appreciate any help if any there are any other things I could try (though I am close to giving up!)

    Thanks as always

    Nick

  7. Andrew Tegenkamp
    Member
    Posted 2 years ago #

    Nick,
    Have you tried going to /wp-admin/options.php and changing either the home value and/or the siteurl value? I'd try a few of those combinations as I believe you can work with those to change the main url around even after setting up a network. If not, let me know as I will be needing this setup for a project in development myself so I'll certainly help figure it out with you!
    -Andrew

  8. gh0zt
    Member
    Posted 2 years ago #

    Fastest way to do this is edit the database directly, it's really quite simple. Make a backup first.

  9. Nick Davis
    Member
    Posted 2 years ago #

    Hi guys

    This is what I did and it seems to work, my only worry is I'm storing up some pain for later in that I might be potentially affecting some else that I'm not aware of (yet)

    1) Logged into phpMyAdmin and selected the database.
    2) Changed the site_url and home settings in the wp_options table from "example.com" to "www.example.com".

    Hope that helps someone but as I say maybe it is not the correct way

  10. Andrew Tegenkamp
    Member
    Posted 2 years ago #

    Nickyboy, yea, what I said about /wp-admin/options.php just is an unlinked page in WP Admin that shows you all the wp_options table choices in WP's Admin in case you can't or don't feel comfortable accessing via phpMyAdmin so I think you've done what everyone has said one way or another. I've changed this before in single sites and it's been fine, so you should be good :)

  11. Nick Davis
    Member
    Posted 2 years ago #

    Thank Andrew, I meant to thank you for your suggestion too!

    The reason why I did it in the DB in the end was I was worried about losing any changes in that file in later WP upgrades, though now I think about it I'm not sure it would've been affected anyway

    To give an update: I've only seen one 'ill effect' since changing the DB and that is using the BackUp Buddy plugin, it no longer appears to backup successfully when requesting a new backup, however afterwards when you check it seems to have apparently backed up fine, so hopefully - and by the sounds of it - it is only a cosmetic issue rather than anything actually breaking (and therefore can be lived with).

    I have to say my first choice for all of this would've been something in .htaccess as I feel that would still be 'cleaner' than editing the DB or files but as I mentioned I could not get this to work in multisite sadly. Despite trying many different approaches the best I could do was the dreaded infinite redirect loop.

    Hopefully this all helps someone else who may face the same choices later on

    Cheers

    Nick

  12. pat2kin
    Member
    Posted 2 years ago #

    Hello,

    I am having the same problem as OP. So, I have created a site http://example.com and subsites http://fr.example.com, http://de.example.com (using WP multisite).

    Now, I need to map http://yahoo.example.com to http://example.com. They are basically the same site except for a small change in the header and footer (which I handle in the theme files).

    How do I do this? Installed domain mapping plugin, and it lets me map "http://yahoo.example.com" to "http://fr.example.com" (site id 2), but it does not let me map "http://yahoo.example.com" to "http://example.com". I tried what Andrew suggested above (first create a mapping to site id 2 and then change domain_mapping table). It seems to work, but I am worried that its a hack and will break something else.

    Any inputs is highly appreciated? Can I use this hack in PROD?

    Thanks
    Sriram

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic