[resolved] Can't get rid of secondary domain (11 posts)

  1. Inposure
    Posted 4 years ago #


    * 1 stand-alone self-hosted WP blog a.com
    * 1 multisite self-hosted WP blog with three domains b.org (main), c.net, d.info

    I decided to finally incorporate the old a.com into my multisite setup.

    I didn't fiddle with DNS settings, as it works just fine adding a new domain new.b.org to /etc/hosts on both server and client. new.b.org installed fine, and I shaped it as planned.

    Then I changed the apache configuration to let a.com point to my mulstisite install, and restarted. I added a.com in WP and made it a primary domain.

    From my point of view, all these steps are just PITA, since I don't want subdomains, but real domains. Therefore I want to get rid of the initial new.b.org and just retain a.com, just the way I did with my other three domains.

    This obviously involves poking around in all option pages, but somehow I just can't get rid of it entirely this time. In the admin panel, the Web Sites menu still retains new.b.org, although all references to new.b.org are wiped from the database (I did a thorough grep of a dump), except for a text string referencing a google search on new.b.org in the panel prefs (which possibly can't be the culprit).

    What am I missing here? Where should I go to kill the last instance of new.b.org?

  2. What domain mapping plugin are you using?

  3. Inposure
    Posted 4 years ago #

    WordPress MU Domain Mapping

  4. Did you check the box to allow remote login?

    The login page will probably stay new.b.org, but the dashboard and the rest will go to newdomain.com

    I wouldn't be messing with the DB, though, as you shouldn't need to and you'll break stuff.

  5. Inposure
    Posted 4 years ago #

    No difference. The point is that WP can't come up with new.b.org at random, it must be picked from the DB. And I can't find it there.

    siteurl = a.com
    home = a.com

    etc. Can't find anything in the main blogs options or other tables either.

    new.b.org is nowhere to be found, not even in serialized array strings.

    Everything works as intended, except for the admin bar and other places where all blogs are listed; it will show new.b.org rather than a.com in those places.

    If I follow that link, I will be redirected to my 404 page, since there is no such blog. (And later I have also removed new.b.org from /etc/hosts, and I don't have a wildcard DNS setting, so the host doesn't exist.)

    It is not a cache issue… just tried logging in from a fresh test browser. Unless there is a hidden files cache that WP uses.

    So WP doesn't seem to resolve existing blog URLs from any obvious settings, and I am completely lost trying to follow the code into any depth.

  6. The plugin you're using is supposed to seamlessly handle it for you, which is why I'm smacking your hands to get you out of the DB ;)

    WP MUST know that a.com == blah.b.org, so it can parse your code. If you screw around with that in the DB, you screw up your site (unless you're only editing the wp_x_posts table to fix internal links, which is sensible and fine).

    Normally I'd point you to http://ottopress.com/2010/wordpress-3-0-multisite-domain-mapping-tutorial/ for a how-to, since I think you set this up worong, but Otto's getting a 502 for me :(

  7. The free plugin still does show the subdomain in some places. There is a paid one that hides them all.

    If you really do plan on editing the db directly and never plan on UN mapping the sites, do a search on *all* tables to find what you missed.

  8. Inposure
    Posted 4 years ago #

    Actually, no. My c.net and d.info have no corresponding c.b.org and d.b.org, since I deleted them. It has been done before.

    WP just needs associate domains with IDs, no need for extra subdomains. That is a leftover from old MU, it shouldn't be that complicated.

  9. Inposure
    Posted 4 years ago #

    @Andrea_r: OK, so I guess it still is hidden somewhere, just that I can't find it; have to look more carefully.

    Didn't know there was a paid version :) But then it makes more sense and gives me a better clue.

  10. Inposure
    Posted 4 years ago #


    Turned out to be a cache problem after all… APC seems to have stored the old domain name in its cache and never updated, probably because the relevant PHP scripts were untouched. Cache should expire after 2 hours, though. Simple restart of apache revealed the problem.

    Poking myself in the forehead, telling myself to remember…

  11. You can restart httpd to flush APC, by the way :)

Topic Closed

This topic has been closed to new replies.

About this Topic