Domain mapping plugin not forcing https on admin side for subsites that are domain mapped?

I domain mapped one of my subsites and I need the front and admin to be https. However, only the front end is https and the admin for the mapped domain is http. The settings for the mapped domain (using the Domain Mapping plugin) on the subsite is set for https, but it is not working for the admin.
It is stated here on another thread LINK that the developers are making it so https will be controlled on a per site bases (admin side and front end) as well as the primary site of the network.
I see in the main settings for the Domain Mapping plugin I can set the main site to either http or https for the front side and admin side, but child sites/subsites has only the https/http setting and does not specify admin or front side.
I am a little confused, but what I need is to make a child site/subsite that is domain mapped https for both the front and admin side.
One side note....I have not setup a cert for this site as I am just testing if the forced https will work within the DM plugin. Does not having a cert cause the https not being forced on the admin side have any effect?
Is the DM plugin supposed to force the https on the admin as well as the front end for subsites that are domain mapped and set for https?

  • Michael Bissett
    • Recruit

    Hey @David Labbe, hope you're doing well today! :slight_smile:

    At present, it'll force https on the admin side of things, but only for the original domain, not the mapped one.

    I see that you've got "Administration mapping" set to "mapped domain" presently, could you try changing it to "original domain" please, and letting me know if that gets https going here?

    Please advise,

  • David Labbe
    • Design Lord, Child of Thor

    Setting "Administration mapping" to "original domain" does not force https but does force the use of the original domain which is not what I want to happen. I need the mapped domain to show with https for both the front and admin side.
    Are you saying that setting "Administration mapping" to "original domain" should have forced https to work on the admin under the original domain?

  • David Labbe
    • Design Lord, Child of Thor

    After digging around I found where and how this is happening.
    If I remove the (!is_admin) from the conditional check then I get the forced https on the front and the admin side of the mapped one would expect with the mapped domain setting set to https.
    I have not tested this with a live cert ( as I said I am just testing how to force https for right now), nore I do not know what other issues this may cause if I was to remove the (!is_admin) without further testing and understanding the code fully at this point.
    Why does the plugin come without the ability of not being able to force https on mapped domains for the admin side?

      • David Labbe
        • Design Lord, Child of Thor

        Not sure I understand...I have not tried to force https without domain mapping. I am only trying to force https through the Domain Mapping plugin and don't wish to use another plugin to force https if I need to.
        Any ideas on what might be wrong or how to go about this?

        • Ajay M Aravind
          • The Bug Hunter

          It is a method of trouble shooting. At first we need to know is admin ssl working on your site. So we should test without domain mapping.
          Step 1: create a subsite without domain mapping, try using https in admin area of the subsite. Is it working? then report here

          Step 2: add this to your wp-config.php

          define('FORCE_SSL_ADMIN', true);
          if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')

          then try step 1 again. report here what happens

          • David Labbe
            • Design Lord, Child of Thor

            Ok..How do I use https within the admin (step 1) without a plugin or the script from step 2? I have tried a variation of step 2 yesterday with a conditional that only made it https for the specific site. LIke below..

            if ( $_SERVER["HTTP_HOST"] == "" ) {
            	define('FORCE_SSL_ADMIN', true);
            	define('FORCE_SSL_LOGIN', true);

            I don't have the cert active so I got a "SSL connection error" which is fine and the URL had https://... So I assume that is the results I should receive without the cert active.
            However, I will be having many mapped sites and don't wish to be adding a conditional statement in the wp-config.php for everyone.
            That is why I am trying to see why the Domain Mapping tool is not forcing the admin https when the domain is set to https within the settings.

  • Ajay M Aravind
    • The Bug Hunter

    I have to go completely through domain mapping code to get the problem causing this.

    If I am right, Domain mapping could force mapped admin to https only if already the subdomain admin is in forced https. This is an assumption. Let me check the exact method and revert to you tomorrow.

  • David Labbe
    • Design Lord, Child of Thor

    @Ajay Aravind Any update on this? I have been doing some testing and if I remove this
    Then things seem to work...can you see where this would cause an issue?

    However, I am having an issue or could be a bug (this happens before I modify the code as above also) in that all the links for all the sites within the admin bar are https if I load a site with https. Let me explain...

    I have a site that is domain mapped set for (ssl) https and I have other sites that are not (ssl) https. If I go to the site that is ssl and then navigate to another non-ssl site from the admin bar (My Sites) it will take me to that other non-sll site, but the link will be https. Then because that site is not set up with ssl it will cause the browser cert warning error. However, if I go to a site that is non-ssl first then the links within the admin bar are fine...non https.
    The ssl site will also show links without ssl, but if I click a link from the admin bar for the ssl site , https will be forced and will work ok.
    Yes...confusing I know, but bottom line is that the admin bar links within (MY Sites) are being compiled based on the https/http status of the site first logged into.

  • Ash
    • WordPress Hacker

    Hello @David Labbe

    I have just talked to the developer @Sam and this feature is still under development. Let me bring him in this thread for his valuable opinion on this. Please note that, developer response might be slower than usual staff response, so we appreciate your patience on this.


  • Sonya
    • Design Lord, Child of Thor

    I am having the same issue. In the Domain Mapping Settings , when I choose to make all login and admin pages to be https, it doesn't do it. When I add `define('FORCE_SSL_LOGIN', false);
    define('FORCE_SSL_ADMIN', false);` to the wp-config file, I keep getting stuck in a redirect loop when trying to access the dashboard or login page regardless of the Domain Mapping settings. Everything is fine for subsites that are installed at the default network domain. It is the sites that I have domain-mapped that are not being forced into https for Login or Admin pages, or getting stuck in redirect loop when wp-config file has Force SSL.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.