[resolved] The domain mapping plugin only works if the site is installed in /. (25 posts)

  1. phantasmix
    Posted 3 years ago #

    Having issues with the multisite...

    Here's our setup:
    • Main multisite domain is at http://www.domain.com
    • Other multisites are in subdirectories: http://www.domain.com/sub1/, http://www.domain.com/sub2/ etc.
    • I parked several domains on top of http://www.domain.com
    • Using the plugin, I mapped those domains to subdirectories on the multisite
    • If I don't make the domains as primary, everything works fine
    • If I make the normal URLs (www.sub1.com) as primary, then I can see the frontend site just fine, but getting this error when trying to reach that site's dashboard:

    "The domain mapping plugin only works if the site is installed in /. This is a limitation of how virtual servers work and is very difficult to work around."

    I don't understand how it applies -- our main site is installed in / and always has been (as far as I know!)

  2. phantasmix
    Posted 3 years ago #

    I have discovered that originally this multisite was set up at an IP address like this:

    It has since been moved to http://www.domain.com but I'm guessing something's left over from the time when the main domain wasn't in the root.

    Where would I look for the "leftovers" in the database?

    Thanks in advance!

  3. phantasmix
    Posted 3 years ago #

    Thank you. I did a basic search earlier today and examined each instance of the old URL. Didn't find anything relevant.

    On another but possibly related note, if I login to a mapped domain dashboard using superadmin user/pass, I still get the error, but when I return to the frontend, it gives me that admin bar at the top. Then if I click on My Sites -> Network Admin -> Dashboard, it takes me to the wrong URL, that's missing COLON ":" like this


    I just upgraded the network to the latest WP version but that didn't help anything.

  4. Protip: If you don't think it's relevant, but you're STILL having issues, it's possible you're wrong ;)

    Also make sure you updated the wp-config.php

  5. phantasmix
    Posted 3 years ago #

    Good tip :) doesn't hurt to be reminded.
    Just used the script. It replaced 3 records and that didn't fix it either.

    Any ideas as to the missing : in URL?

    Thank you!


    This is from wp-config:

    define('WP_ALLOW_MULTISITE', true);
    define( 'SUNRISE', 'on' );
    define( 'MULTISITE', true );
    define( 'SUBDOMAIN_INSTALL', false );
    $base = '/';
    define( 'DOMAIN_CURRENT_SITE', 'www.domain.com' );
    define( 'PATH_CURRENT_SITE', '/' );
    define( 'SITE_ID_CURRENT_SITE', 1 );
    define( 'BLOG_ID_CURRENT_SITE', 1 );
  6. Unrelated issue:

    Don't use WWW. Change this:
    define( 'DOMAIN_CURRENT_SITE', 'www.domain.com' );

    to this:
    define( 'DOMAIN_CURRENT_SITE', 'domain.com' );

    Related issue
    Search your DB for http// just for a laugh.

  7. phantasmix
    Posted 3 years ago #

    Done and done.

    1) I think it might actually be related to the subfolder install problem. Probably a ':' or '/' missing somewhere and causing both issues. I mean, it's possible, right?

    2) Nothing found for http//

  8. phantasmix
    Posted 3 years ago #

    I think the two are related, because I only get the Dashboard and Logout links with "http//" from the mapped domains' frontend. When those mapped domains aren't primary, Dashboard and Logout links work fine.

    (while the backend of the same mapped domains doesn't work at all due to the above "...only works if the site is installed in /.").

  9. Which plugin are you using to map?

  10. phantasmix
    Posted 3 years ago #

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

    I found just one other one - PRO something, but couldn't figure out if it would help.

  11. I'm using that one and it's okay. So I suspect you've applied settings wonky.

    Examples from my site:


  12. phantasmix
    Posted 3 years ago #

    I use that plugin on another multisite network that works fine, and copied the settings from there. One difference - the other network is on subdomain setup, not subfolder.

    In the mapping options I have only 2 items checked:
    "Permanent redirect" and "User domain mapping page".

    To summarize, when I set the http://www.subdomain1.com etc. as primary:
    http://www.subdomain1.com frontend works;
    http://www.subdomain1.com/wp-admin/ throws out "The domain mapping plugin only works if the site is installed in /. This is a limitation of how virtual servers work and is very difficult to work around."
    • If I check "Redirect administration pages to site's original domain..." in the Network Admin mapping options, I can (sort of) access http://www.subdomain1.com dashboard, but of course it takes me to http://www.domain.com/sub1/
    This is also when I get the broken logout/dashboard link with the missing colon (:) --- that's why "sort of".

    If I don't set http://www.subdomain1.com as primary, it redirects me to http://www.domain.com/sub1/ just fine, and everything else works as it should.

    I really appreciate you trying to understand and help, not easy to get the full picture this way :)

  13. What OTHER plugins are you running? Something's GOT to be conflicting here...

  14. phantasmix
    Posted 3 years ago #

    • Constant Contact Widget
    • Diamond MultiSite Widgets - hmmm, this one's suspicious (pushes posts to multiple sites on the network simultaneously)
    • Events Manager - on some sites, not all of them
    • Featured Content Gallery
    • Featured Page Widget
    • Genesis runs on 2 sites out of 7
    • Google Analyticator
    • Gravity Forms
    • Homepage Featured Posts Widget
    • List Category Posts
    • Login Form Shortcode
    • Redirection (no rules in place right now)
    • Relevanssi Premium Search
    • Restricted Site Access (running on a few, not all)
    • Widget Logic (on some)
    • WordPress Access Control (password protects individual pages, including the sidebar)

    Should I start disabling them one by one? Anything jumps out at you?

  15. I ran Diamond MultiSite Widgets and it was fine.

    Turn off Redirection (I know you have no rules in place, but ...)

  16. phantasmix
    Posted 3 years ago #

    thank you for all your support (on a weekend no less!) but the client wants to use http://www.domain.com/sub1, /sub 2 etc.

    Go figure...

  17. So ... wait, they're fine with the subfolders and don't want domain mapping? *head desk*

  18. phantasmix
    Posted 3 years ago #

    Exactly. Face palm.

    That wasn't in the project brief, was just told this morning "Oh yeah, the old domains are going bye-bye anyway."

    Sorry for wasting your time :(
    Hope there's a lesson in there... somewhere.

  19. *LOL* Nah, it's okay :) I do this for free and fun anyway.

    Which probably means I'm a masochist.

  20. hampus_b
    Posted 3 years ago #

    I've got exactly the same problem - did you ever find a solution to the problem? Tried disabling all plugins except wordpress-mu-domain-mapping - didn't help.

  21. hampus_b
    Posted 3 years ago #

    btw, tried to disable ALL plugins except wordpress-mu-domain-mapping.

  22. hampus_b
    Posted 3 years ago #

    Ok, went to the file domain_mapping.php and make a output of "$current_site" just before the the error is thrown. It seems like $current_site->path is NOT set to "/" in my case, instead it's set to nothing. A quick and dirty solution is to edit the plugin-file like this:

    if ( $current_site->path != "/" )
    if ( $current_site->path != "/" AND $current_site->path != '' )

    Better solution... Seems like the there is a problem in the wp_site. Go to the database, find the wp_site-table and set the "path"-column to /

  23. hampus_b - Please make a new topic all your own :) When the last post is more than a couple months ago, we reeeeealy like you to make your own topic, since WP versions roll over pretty fast, and many things change in a month.

    The plugin works just fine, provided you installed WP in root.

  24. hampus_b
    Posted 3 years ago #

    Sorry ;)

    Well, it didn't work. Got "The domain mapping plugin only works if the site is installed in /."-error even though installed in root. Guess the problem occurred from installing as subdomain MU and changing to folder-based, or the other way around. Well, solved anyways.

Topic Closed

This topic has been closed to new replies.

About this Topic