Need help with Domain Mapping

I had the Domain Mapping plugin, and I accidentally toggled the force https on when I don't have an SSL certificate.
My provider removed the plugin for me, but I'm afraid that if I download and install it again, it'll somehow remember my old settings and lock me out of my site's backend again.
Can you help me figure out where Domain Mapping stores its settings and walk me through so I can shut that feature off?

  • Adam Czajczyk

    Hello Azurite,

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

    I understand that you have a domain mapped to one of your sub-sites and you have switched the scheme on "Tools -> Domain Mapping" page in that sub-site's dashboard and as a result you lost access to that site, is that correct?

    If yes, there's no need to remove the plugin. You should be able to install it again via Network Admin and after you network activate it, go to the

    Network Admin -> Settings -> Domain Mapping page

    and switch to "mapped domains" tab there.

    You will find the site in question on the list and in "Actions" column for it there's a blue "key" icon that you can use (as a super-admin) to toggle scheme again. Once you toggle it to "http" you should regain access to that affected sub-site.

    In case you needed this anyway, here's how to fix that directly via the database:

    1. you need to access your multisite WP install's database using phpMyAdmin
    2. find the "wp_domain_mapping" table (please note: I used default "wp_" prefix for this guide but on your setup the prefix might be different; but regardless of the prefix, the table name will be domain_mapping).
    3. you will see a list of records there so you need to find a row where the "domain" value is that mapped domain of affected site
    4. edit that row and in the "scheme" field change whatever value there is to just 0 (zero) and save changes.

    This will toggle the scheme to "http://" as well.

    I hope that helps!

    Best regards,
    Adam

  • Azurite

    Hey there,
    What actually happened is that I had Domain Mapping activated so that another domain I own can map to one of my network sites on my WordPress Multisite install. I was troubleshooting what I *think* is another plugin's glitch with user registration supposedly being disabled (despite my site settings to the contrary) and turned on the Force HTTPS feature... and because I don't have an SSL certificate installed, caused me to lose access to my whole site. Not just one of the network sites --the WHOLE thing. I couldn't get into the backend at all.

    I tried deleting the plugin, but it didn't work; once I reinstalled and activated it, the setting "came back" and I was locked out of my site again. I tried following the steps that you indicated above, and did change the "scheme" to 0, but it didn't help-- as soon as I reactivated the plugin again, it immediately wanted to "force https" for me looking at the WPMU Dev Dashboard for the plugins-- and I can't get to any of the sites in the main network (not the mapped domains).

  • Predrag Dubajic

    Hi Azurite,

    If you changed the https lock for the single subsite this shouldn't be affecting your other sites at all, so are you referring to forcing SSL on the Domain Mapping network settings?

    I would like to investigate this further but as I don't have access to your files I can get your site backend locked during the tests and not be able to bring it back.
    Could you provide us with cPanel login so we can investigate it further?
    You can send us your details using our contact form https://premium.wpmudev.org/contact/#i-have-a-different-question and the template below:

    Subject: "Attn: Predrag Dubajic"
    - Site login url
    - WordPress admin username
    - WordPress admin password
    - cPanel credentials (host/username/password)
    - Link back to this thread for reference
    - Any other relevant urls/info

    Best regards,
    Predrag

  • Azurite

    Hey there,
    I've sent the information you requested. I did use the Network Settings for the plugin, as I don't see any per-site settings-- or at least, I didn't when this all happened.

    As of right now, I have moved the domain-mapping plugin to a plugins_deactive folder, so I can access MOST of my sites (frontend and backend), but I wasn't (as of last night, anyway) able to access the mapped domain... I can now, though, which is REALLY weird. So now I'm not even sure if I need the Domain Mapping plugin at all?!

  • Predrag Dubajic

    Hi Azurite,

    Thanks for sending those in, I tried checking your site but I'm afraid that I can't login to your network at all.
    When I go to wp-admin or wp-login.php url it redirects me to 404 page without any login form.
    I also tried going to /profile/login/ and there's a shortcode for login form but the form is not rendered so I can't login there either :slight_frown:

    Your cPanel was also working strange for me and I kept getting broken layout so I couldn't use any of the options to check your setup:

    It seems there are some hosting issues with your site and you might want to check this with your hosting provider first to make sure everything on that end is running properly.

    Can you tell me if I'm missing something else here and how could I access your admin section?

    As of right now, I have moved the domain-mapping plugin to a plugins_deactive folder, so I can access MOST of my sites (frontend and backend), but I wasn't (as of last night, anyway) able to access the mapped domain... I can now, though, which is REALLY weird. So now I'm not even sure if I need the Domain Mapping plugin at all?!

    WordPress added option to map a domain with 4.5 release so it can still be done that way, and perhaps that's what you have configured so it works without Domain Mapping plugin?
    However Domain Mapping comes with some additional options like single sign-on, multiple domain mapping for single subsite, SSL options, etc.
    So basically it depends on the usage you're looking to have on your site.

    Best regards,
    Predrag

  • Azurite

    Hi there,
    So the WordPress login issue is probably coming from the fact that I have restricted access to the backend/login forms via .htaccess. I can add your IP range if you email it to me.

    I am also trying to solve this from the other end --actually getting an SSL certificate so I *can* force HTTPS. I got a free SSL certificate for both domains (wildcards covering both the base domain and my mapped domain), and I have checked with Cloudflare that they're both active. I copy-pasted everything into the SSL/TLS section of cPanel, but I still get errors when trying to visit https:// (my base domain) -- I have to manually trust the certificate because it appears to be issued for the mapped domain, not the base domain (that is, a "host name mismatch").

    I have the UserPro plugin from CodeCanyon/Envato that is supposed to redirect any backend log-ins, etc. to the front-end, but they should still work with the right credentials. I can also turn those options off temporarily (my understanding is that because they're front-end, they bypass the wp-login.php file I've restricted in my .htaccess).

    I have no idea why the cPanel would have looked so weird for you, though.

  • Azurite

    Hi there,
    So I decided to (hopefully?) solve this issue by getting a free SSL certificate from Cloudflare. I reinstalled the Domain Mapping plugin and verified that it works --my mapped domain is back and working, and I removed the UserPro backend-to-frontend redirects.

    However, I'm still concerned as to whether or not people will see "insecure" when they visit either the main domain (or one of the WordPress multisite subdomains) or the mapped domain, and rather than "trust" the certificate for that browser/user account/operating system, they'll just click away.

    So, can you try again (no need for whitelisting IPs; I removed that feature from my .htaccess and am now relying on Defender) and see if everything loads properly?

    Thank you!

  • Predrag Dubajic

    Hi Azurite,

    I can now access your network admin as well so I checked couple of your sites, the main site and mapped domain are working fine, they are loading HTTPS version and they have a green padlock.
    However most of your subsites are also being loaded via HTTPS but they are showing "ERR_CERT_AUTHORITY_INVALID" error.

    I checked about dozen of subsites and only two were loading without HTTPS and those were windswept and mou subsites.
    Perhaps you can check what's specific to those two so they don't load over HTTPS and apply the same thing to your other subsites?

    Best regards,
    Predrag

  • Azurite

    I have no idea why only those two sites would load without HTTPS (or why the certificate would come up as invalid; it did that for me when I visited MOU in Chrome; I had to manually proceed to the "unsafe" website, even though the supposedly-invalid certificate DID have a wildcard for my subdomains).

    Of the two, only MOU is mentioned in my .htaccess file, since I'm redirecting people from the old URL seventh-star.net/mou to the new URL, mou.seventh-star.net. Windswept isn't mentioned in my .htaccess at all, since it's a brand-new site. I can't think of any reason why it would be any different from many of the other WordPress-powered subdomains.

    In the Domain Mapping settings for individual sites, should I be forcing HTTPS there as well, or should having the setting enabled from Cloudflare's end be enough? I don't want to create any redundancies...

  • Predrag Dubajic

    Hi Azurite,

    Your Domain Mapping settings in Network admin are currently set not to force HTTPS and your subsite with mapped domain is working properly with HTTPS so other subsites are not actually affected by Domain Mapping plugin and something else is forcing the https there.

    What I also noticed now, that I missed last time, that the two domains I noticed are not loading over HTTPS when I visit them from different browser or incognito mode but when I try to access them from the network admin, or go to login page it does use https, so there's something forcing HTTPS for admin section.

    This is something that's forced either from CloudFlare or something in your server settings so it would be best to contact them about this as they can have a closer look at the settings and give you more info about what exactly is going on.

    Best regards,
    Predrag

  • Azurite

    Hi there,
    I do have Cloudflare set to Force HTTPS. Do you think it makes more sense to enable this feature from WordPress, either via the Domain Mapping plugin or something else (e.g. Force HTTPS plugin, or something in wp-config.php)?

    Right now, as far as I know, I don't have anything else controlling SSL/HTTPS besides CloudFlare-- they had me install a certificate in my cPanel, but that's it.

    However, it's causing problems with Jetpack, and so I'm thinking of disabling the Force HTTPS from CloudFlare's end, at least until I can re-enable Jetpack. I mainly want HTTPS for login pages, so does it make more sense to just enable it for some pages on the site, like the admin or pages where someone has a front-end login (e.g. from UserPro)? I obviously still want the benefits of improved SEO, so that's why I originally did a blanket-Force HTTPS for every page... and yet, most browsers don't seem to like self-signed certificates after all... *sigh*

    Is there anything more I can do?

  • Azurite

    Okay, so here's what I've had to do to get (most) everything working:
    I turned off CloudFlare's Force HTTPS and Automatic HTTPS rewrites. I think it makes more sense to control this from the WordPress end, or files/settings on my server, where possible.

    I have had to add CNAME records for each of my "wildcard" subdomains to CloudFlare manually, which means HTTPS now works for my subdomains. There was a scary glitch for a bit where my main sites and the mapped domain got 403 errors, but those got fixed by editing the .htaccess file to have a more efficient Force HTTPS rule. There's also the Force SSL for Admin setting in wp-config.php.

    At this point, I think I can successfully access all of my sites over HTTPS, but I'm going to try and fix all the mixed content. I think that might be why my Media Library for at least one of my subsites isn't working, and only shows gray squares. I've already tried checking WP Smush and Regenerate Thumbnails, to no avail.

    • Azurite

      Hi there,
      Access has been granted again!

      Turns out the reason why my images disappeared from my sites was that one of the lines I removed from .htaccess was the all-important one about ms-files.php, which handles multisite files and where they can be located in the blogs.dir structure.

      So that fixed those images... I think. There's still a subdomain of the mapped domain that refuses to load, and I keep getting mixed messages relating to Browser Caching (Hummingbird), Multi-Domains (in the URL of the subdomain of the mapped domain, when it doesn't load; it appends a bunch of stuff about multi-domain authorization)...

  • Adam Czajczyk

    Hello Azurite!

    There's still a subdomain of the mapped domain that refuses to load...

    Which one is that? I'm not sure because the only "subdomain of mapped domain" that I see on a list of your sites is the "libraryinterns.me....com" which seems to be loading fine for me, with no mixed content errors and a nice green padlock.

    I found out that the "me....com" itself seems to have "broken padlock" though. It does show some mixed content errors as well, so is this the one?

    If so, the configuration here is a bit strange. What I mean is that the site seems to be using sort of "redundant mapping": first, the "me...com" domain is mapped using core WP mapping feature (it's got "Site URL" set to that domain) and then the same domain is mapped to it using Domain Mapping. Furthermore, it's done twice - with and without "www" prefix. That might be causing issues and I'd rather suggest sticking to "one mapping" only.

    However, I found another issue here: while the "Site URL" for that site was set to start with https prefix, the "Home" and a few other URLs where still starting with "http" prefix. Those should be consistent so I went to "Network Admin -> Sites" and on "Edit" screen for that site, I have adjusted those URL. After clearing up Hummingibird cache, there's only one mixed content error left there.

    If you take a look at browser console you'll notice that it's related to some image from UserPro plugin. Since I'm not having access to the dashboard of that particular site, I"m not sure if there are some options to e.g. upload your own image for login page or something like that but it might be worth checking it.

    Best regards,
    Adam

  • Azurite

    Hi there,
    Things seem to be weird... I'm not sure if it's my browser, my awful Internet issues here at home, CloudFlare, or something with my server, or possibly a setup glitch in one or more files (.htaccess, wp-config, etc).

    So libraryinterns wasn't loading for me for a while, but it is now-- though Chrome isn't showing the green padlock for me (likely because I'm logged in and the mixed content is coming from that UserPro profile image).

    I'm unfamiliar with WP's core domain mapping; I know it's a new-ish feature, but I tried reading up about it and I thought there were steps involved that I couldn't do on my server (I thought). So if that mapping looks correct, do you suggest I unmap that domain using Domain Mapping? I did want to make sure people would get to the website regardless of if they typed the www or not.

    As far as editing the Home and Site URLs go, the only place I thought I was able to do it was via the Network Admin; whenever I visited an individual site's Settings > General, the field for the URL wasn't there, and I assumed it was because I was using WordPress Multisite/Network setup.

    Thank you for your help with this!

  • Predrag Dubajic

    Hi Azurite,

    Unfortunately the support access has expired again, can you grant it one more time and try to keep it open while we're looking into this?

    If you change the site URL and use the mapped domain directly, and have default WP domain mapping configured then using Domain Mapping plugin can cause conflicts as it works with site URL being set to the original domain, not the mapped one.

    Best regards,
    Predrag

  • Azurite

    Hi there,
    Support access has been granted again.
    This is the first time I've tried to use SSL, so I'm wondering if the reason why I'm only now experiencing issues with the Domain Mapping and WP's Core "mapping" setup is because of that. I haven't noticed any issues before with having my mapped domain listed under the Network Settings with the URL I want everyone to see (vs. the subsite name).

    Should I not be using the Domain Mapping plugin after all, or should I change the Network Settings to be something different?

  • Predrag Dubajic

    Hi Azurite,

    It's quite possible that having SSL in addition to existing configuration is causing this.
    Domain Mapping is tested with using default subsite domains, so we don't know what kind of issues using mapped domain as subsite URL can cause.

    I would suggest testing how your sites behave with only Domain Mapping plugin, without the core mapping, and then without Domain Mapping but with core mapping configured and see how your sites are behaving after that.

    I also checked libraryinterns subsite and green padlock is there for me while both logged in and out so that seems to be in order now.

    Best regards,
    Predrag

  • Azurite

    Hi there,
    So I want to make sure I understand this right:
    In order to remove WordPress's core mapping feature and use the WPMU Dev plugin Domain Mapping, I need to go to the Network Settings and change the URL for the "mapped" site back to what it was originally (the subsite of Seventh Star). People should still be able to get to the mapped domain with no problem, and it will direct properly because Domain Mapping from the plugin is still active. The mapped domain URL is what will show up in the address bar, too.

    However, I also need to remove one of the extra mapped domains in the Domain Mapping plugin settings, because it's unnecessary or confusing to have one that is for www and without www. Even without that, someone should still be able to get to the correct site whether or not they type www [dot] mymappeddomain [dot] com or mymappeddomain [dot] com, right?

  • Azurite

    Whew! Had a brief scare there for a second where I thought that deleting one of the two "extra" mapped domains broke my site, but it turned out one of the mappings was still set to "HTTP" and not "HTTPS," and so it kept giving me a WordPress 404, no matter what other settings I toggled. Once I deleted the invalid mapping and replaced it with the HTTPS version, everything works again-- whether someone manually types the "www" or not (thanks to my existing CNAME record over at Cloudflare).

    Is there ANY reason why I should change the Administration and Login mappings to be the "mapped domain," instead of the "domain entered by user"? At this time, I only have one person who's logging into the website, and I would prefer she see the mapped domain when she logs in, but she's not accessing the backend at all, just a specific page on the site.

    Once that question is answered, I think this is resolved! Huzzah!

  • Adam Czajczyk

    Hello Azurite

    I'm happy to hear that it finally works for you :slight_smile:

    As for "Administration and Login mapping". In that case, I think it's up to you, it doesn't matter much. It's mostly a matter of a personal preference and if the person is not even using back-end, I really don't see any particular reasons for or against forcing the mapped domains in back-end.

    Best regards,
    Adam

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.