Domain Mapping: A better way?

As previous discussions have noted (search: domain mapping multisite login), Domain Mapping causes problems with logins on Multi-site. So many of my site visitors have reported their frustration in getting logged in when I had Domain Mapping installed, I deactivated Domain Mapping from my sites. Now, users report they have no problem logging in to add their comments.

My question:

Given that I have several parked domains on my server that represent sub-sites of my primary domain, is there a script I can add somewhere on my server that will forward a request to a parked domain to my PrimaryDomain/ParkedDomain?

Thanks,

Ed

  • Philip John
    • DEV MAN’s Apprentice

    Hiya Ed,

    If your members have previously logged in while domain mapping is enabled then cookies will be stored on their machine referring to the un-mapped domain.

    Subsequent attempts to login using the mapped domain will cause problems because the cookies will conflict with new ones that will need to be set.

    Have you had your users clear cookies and try again?

    Phil

  • exberry
    • The Incredible Code Injector

    Phil,

    Thanks. In my case, many new people signup but then are unable to login when Domain Mapping is active. Only by deactivating Domain Mapping can they then easily login to any sub-site.

    Attempting to ask my users to clear cookies is impractical. Most of them don’t know what a cookie is and they never want to know. They just depend upon me to make using my site as simple as possible. The only way I know how to do this is by deactivating Domain Mapping.

    Now, I am just looking for a script to forward users to their desired sub-site.

    Ed

  • Saunt Valerian
    • The Bug Hunter

    This is an issue and I agree that we need a better way.

    I posted this: https://premium.wpmudev.org/forums/topic/ajax-and-domain-mapping-dont-play-well-together as another issues that comes with domain mapping. I’ve been using the mapping plugin from the repository which has the same problems except that on a site-per-site basis, you can enable/disable remote login (which is the function that allows a user to login in another part of your network and still be logged in when they visit the mapped site). When I checked the WPMU DEV mapping plugin, it didn’t have any settings for remote login.

    With remote login on, your users can browse to the subsite from a (logged in position) on the multisite network and they will be logged in correctly. However, this breaks Ajax (because Ajax calls are routed to the mapped admin in which the Ajax file doesn’t exist). To get Ajax working, you have to allow the dashboard to be mapped to the domain as well.

    Bottom line is that you can’t have it both ways. Remote login gives a seamless experience to your users, but Ajax doesn’t work (so in many cases, the website won’t work properly). If you want Ajax to work, you have to sacrifice remote login.

    I classify this as a critical issue for multisite and domain mapping because it severely impacts functionality. Feel free to add your voice to the call for a solution!

  • Philip John
    • DEV MAN’s Apprentice

    Hi Ed,

    I believe you would need to use the redirect tools provided by your host to redirect a “parked” domain to your primary domain.

    Or, you can make the “parked” domain an “alias” instead and add a 301 redirect rule to your htaccess.

    Phil

  • exberry
    • The Incredible Code Injector

    Phil,

    Thank you once again. I have been experimenting with parked domains, add-on domains, and unassigned domains. Indeed, I can easily make any subdomain.com produce subdomain.com. But the problem is in logging in. So I can accomplish everything Domain Mapping does without using Domain Mapping.

    There is one bottom line of all the methods: The only way to maintain easy or even possible login for a subdomain is to reference it as primarydomain.com./subdomain. That way the login holds for all subdomains.

    So the problem is not Domain Mapping per se. The problem is in how WP Multi-site works. And Domain Mapping adds nothing to what can be accomplished on a host. The only Domain Mapping problem is it advertises that it can accomplish subdomain logins, whereas in reality it cannot. Or if it can, then it should include specific instructions on how to set it up to accomplish subdomain logins.

    Quote:

    And, naturally, we’ve built in cross domain cookie syncing, so your users will stay logged in (or out) regardless of whether they are on your standard domain or their custom one.

    Question:

    Does Domain Mapping belong in the plugins folder or in the mu-plugins folder?

    I am running it in the plugins folder.

    Ed

  • exberry
    • The Incredible Code Injector

    I must retract all the “bad” things I said above about Domain Mapping.

    Now that I installed Domain Mapping in the mu-plugins folder (as directed in the installation instructions) rather than in the plugins folder, the multi-site login is now working.

    Thanks,

    Ed

  • exberry
    • The Incredible Code Injector

    I thought this topic was resolved but as I test further, the maintenance of login is flakey. I will see what I can figure out.

    Does it have anything to do with the setting in Administration Mapping?

    I set it to “Mapped Domain” and set my menus to the mapped domain, and it now appears to be working.

    Ed

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.