Domain Mapping : Subsite dashboard gives redirect error

I have a website on which I am using Domain Mapping. When I try to go to the Dashboard it gets into redirect loop.

  • Adam Czajczyk

    Hello twinsmagic

    I hope you're well today and thank you for your question!

    I checked your site and I'd like you to try check something (as I don't have access to your CloudFlare). For any example sub-site affected by the issue, could you please:

    1. access your CloudFlare dashboard and check what type of certificate you got set there for the mapped domain.

    You should see one of these options selected in SSL options for the domain: "Flexible", "Full" or "Strict".

    2. Since there's no SSL certification for sub-site, try setting it to "Flexible" for the mapped domain, then clear all caches on CloudFlare and on site/server and try again.

    If that still doesn't help, leave it like that for now but tell me please if you aware if there's any kind of "forced" redirect from http to https on a server - not on CloudFlare as this is for mapped domain - but on your site's end. It can possibly be some plugin setting or some additional rule in .htaccess. Can you recall anything like that? I see that there's some SSL plugin installed with an option set to "per site" so do you recall if some "forced SSL" was set in that plugin settings on affected sub-sites?

    Best regards,
    Adam

  • twinsmagic

    Hi,

    Thanks for your message.

    1. In Cloudflare the mapped domain is using "flexible" already. In CF, I also have
    "Always Use HTTPS"
    and
    "Automatic HTTPS Rewrites" both enabled.

    I don't recall any forced SSL besides the Really Simple SSL plugin. Here is a copy of my current
    .htaccess file: https://www.sugarsync.com/pf/D646892_07204924_1790853

    The only other thing that happened when this all broke was I was getting attacked by bots on my wplogin page so I had to install a recaptha plugin. It was after that that I noticed these issues. I have of course tried deactivating the plugin but the issue persists so I'm not sure if that's related or not.
    Thank you

  • Adam Czajczyk

    Hi twinsmagic

    I did some more checks on the site and I also found out that I actually can access login page at least, when I'm logged out as a super-admin. I mean: when I try to visit the login page as visitor, it loads fine. So the issue happens for logged in users and that means that it's at some mapping or http->https redirect after logging in.

    With some more changes I'm not able to access dashboards:

    - the CloudFlare Flexible SSL Redirect fix plugin disabled
    - the "Administration mapping" option in Domain Mapping settings on "Network Admin -> Settings -> Domain Mapping" page set to "domain entered by the user" (changed from "mapped domain" originally)
    - the "Login mapping" option in Domain Mapping settings set to "original domain" (no change here, set as it was set originally)

    The "side effect" is that back-end (dashboards) in this case are working over original domains, not mapped (though via SSL) but they are working at least. We can try to make them work over the mapped domains too but that might need more "digging into" as there's definitely something causing the redirect and that redirect (the redirect loop) comes, as browser console shows, CloudFlare.

    I don't know if it's CloudFlare alone causing it or it's on the line "between CloudFlare and the site" but the "redirect order" comes from CloudFlare.

    But I have noticed one more important thing too: assuming that the .htaccess that you shared is complete (that it's entire content of the file) it's actually missing the core WP rules. This part (preferably at the beginning) is not there and it should be:

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]

    Therefore, I'd suggest starting with adding it and then clearing all the caches (both Hummingbird Page Cache and Redis cache). Once that's done see if the front-ends and dashboards are still available and then - for testing - try again switching the "Administration Mapping" option in Domain Mapping settings to the "mapped domain" to see if that works or not.

    If it still doesn't work over the mapped domain, there will be either Really Simple SSL issue or part of the mapped domain's CloudFlare configuration (so you might need to experiment with those both "Always use HTTPS" and "Automatic HTTPS Rewrites" options - in fact, it's WP and Domain Mapping that should take care of that).

    Best regards,
    Adam

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.