WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Frontend login fails with Domain Mapping enabled

[Resolved] Frontend login fails with Domain Mapping enabled

  • In brief: Domain Mapping breaks login, if blog is set to force user login before seeing blog contents.

    Domain Mapping on subdomain-type WordPress network always redirects form subdomain to mapped domain. For example, if I have one.page.com site, mapped to one.com domain, whenever I enter one.page.com URL, I’m redirected to one.com domain, if Domain Mapping plugin is enabled.

    If user has enabled (any plugin or own code) that user must be logged in in order to view frontend (blog contents) then login fails and user is all the time redirected back to login form, if Domain Plugin is activated.

    This is problably because WordPress writes login cookie for one.domain.com and this cookie is not available for one.com domain after redirection done by Domain Mapping.

    I don’t know, if there is any fix for this problem, but maybe you try to read login cookie (if exists and if this is possible) from original subdomain before redirection and set the very same cookie for the domain you’re about to redirect.

    Look into this question or this thread for more details.

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

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Ron Rennick

    @wpmuguru

    MultiSite Guru

    The security features in all web browsers prohibit a server on one domain from accessing the cookie from any other domain.

    Change your settings so the user logs into the mapped domain for the admin area as well as the front end.

    I’m quite new to WordPress, so I don’t know about what setting you’re talking about and where to change it? Can you guide me?

    Right now no matter if I use domain.network.com (subdomain URL) or domain.com (mapped domain) I’m always redirected (for login) to domain.network.com/wp-login.php, and after logging-in, your plugin is redirecting me to domain.com, which is why login fails.

    I know very well about security issue you’re talking about. I just suggested, that if your plugin is doing redirection domain.network.com –> domain.com, then it should be able to read WordPress login cookie from domain.network.com before redirection, send it to domain.com as POST or sth and then, the same plugin under domain.com could check, if there is any data sent via POST, if so, then dump it to a login cookie for domain.com. But that’s just my theoretical attempt to solve this problem.

    Ah, I think I found it. Thanks! :]

    I am experiencing similar difficulties. Please delineate the “settings” changes that are necessary to resolve the above-described problem.
    Thank you very much.

    @boise777: First go to your Network Dashboard > Settings > Domain Mapping Configuration and make sure that you:

    a) set your server’s correct IP address,

    b) checked first four (out of five) checkboxes bellow (at least this is, what I have checked).

    Then go to dashboard of each site of your network, to Tools > Domain Mapping and change Primary Domain from subdomain to your top-level domain.

    If I’m not mistaken, if you add new site to your network, by default its domain will be set to subdomain.network.com and you have to manually switch it to your top-level domain.

    Hello trejder,
    After making the above settings, all is working very well. Thank you!

    Glad, I could help! :] All the best…

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Resolved] Frontend login fails with Domain Mapping enabled’ is closed to new replies.