Domain mapping not working

Hi,

This site has Let's Encrypt, so the install is in sub-directories. The problem is the front end does not display right, seems like a CSS (or other scripts) issues.

This is a new install, I've deactivated plugins one by one, the theme is wp 2016, didn't install another theme until after trying everything else, it didn't change anything.

I've tried every possible settings combination in DM plugin, with or without https, still the same.

If I delete the mapped domain, the site displays just fine on the sub-directory domain.

I even deleted the whole install and started all over again, still the same issue!

The main site, admin and sub-directories domains work just fine

Any ideas what might be the issue?

Another regarding the mapped domain, if I map the domain as https, I get this:

This site is not secure, continue at your own risk!

And to top it all, now I can't even delete the mapped domain!

Regards
Dennis

  • Dimitris

    Hey there Dennis,

    hope you're doing good today!

    The problem is the front end does not display right, seems like a CSS (or other scripts) issues.

    Is this happening for the mapped domain?
    Is the issue here that the mapped domain is under SSL and it's trying to get assets (styles & scripts) from non-secure (http://) destinations? Please advise! :slight_smile:

    I've tried every possible settings combination in DM plugin, with or without https, still the same.

    Are there valid SSL certificates for both main domain (which use the WP install) and the mapped domain? Please advise! :slight_smile:

    Please consider granting us with support access to your website via our "WPMUDEV Dashboard" plugin as described here https://premium.wpmudev.org/manuals/wpmu-dev-dashboard-enabling-staff-login/ in order to have a better look on your settings.

    Kind regards,
    Dimitris

  • Dennis

    Hi Dimitris,

    Is this happening for the mapped domain?

    Yes

    Is the issue here that the mapped domain is under SSL and it's trying to get assets (styles & scripts) from non-secure (http://) destinations?

    Not sure if I follow you here but, I've tried to map both http and https, admin for all sites is https.

    Are there valid SSL certificates for both main domain (which use the WP install) and the mapped domain?

    Only for the main domain, domains point from Godaddy and name.com - still the same issue. I didn't do any parking or other stuff in Cpanel.

    Please consider granting us with support access to your website

    Access is open!

    Regards
    Dennis

  • Adam Czajczyk

    Hello Dennis!

    As for mapped domain.

    How are the "mapped" domains set up? I mean: are they just pointing to an IP or are they added (parked? add-on?) to your server? If they are added to your server, is their root folder properly set to point to the root folder of your main domain?

    Please advise!

    As for SSL certificate.

    A certificate is always related to the domain and is issued for a specified domain. A regular certificate is a "single-domain" certificate so it won't work for domains other than the one specified during purchase. It would cause issues like the one you described. It wouldn't even work for sub-domains.

    The "wildcard" certificate would work for main domain and sub-domains but still will not protect mapped domains. The solution is either to switch to a Multi-domain certificate (and this would require you to specify all the domains during purchase; it's quite pricey as well) or to install multiple certificates at once. A lot of hosts allow multiple certificates nowadays so it would be best to ask yours if it's possible.

    Then you could simply issue an additional certificate for your mapped domain and this would solve this issue.

    Best regards,
    Adam

  • Dennis

    Hi Adam,

    How are the "mapped" domains set up? I

    I followed this info:

    https://premium.wpmudev.org/project/domain-mapping/#usage
    https://premium.wpmudev.org/blog/domain-mapping-update/
    https://premium.wpmudev.org/blog/ssl-domain-mapping/
    https://premium.wpmudev.org/blog/adding-free-ssl-https-wordpress/

    I've a one-click Let's Encrypt installer in my Cpanel

    I was not going to use https for the mapped domains, as I said above, I've tried every settings combination. Notting works, it should work without the https or?

    Regards
    Dennis

  • Adam Czajczyk

    Hello Denis!

    Thank you for your replay.

    As for domain mapping.

    I followed this info:

    https://premium.wpmudev.org/project/domain-mapping/#usage
    https://premium.wpmudev.org/blog/domain-mapping-update/

    There's more than one way to setup domains for mapping described there, that's why I asked how exactly did you do this. I'm sorry for asking the question again, but this can make a difference:
    - are the domains added to your server or just point from external DNS via IP?
    - or are they added to your server (the same where the site is hosted)?
    - if added, are they added as parked or add-on domains?
    - what about "root folder" for the domains?
    - are there any redirects setup?
    - finally, if you "unmap" the domain, what happens when you type that domain name to the browser's address bar - is there any redirect or is the sub-site loaded or the main site of your domain?

    Let me know please. I'm asking this only to get a full picture of the case.

    I've a one-click Let's Encrypt installer in my Cpanel

    I was not going to use https for the mapped domains, as I said above, I've tried every settings combination. Notting works, it should work without the https or?

    Mapped domains and/or original sub-domains do not need to use SSL. They may be served over SSL if you wish to and have appropriate certs installed (at least wild-card for main domain and its sub-domains and either Multi-Domain or multiple separate certs for mapped domain) but that's not a requirement.

    Your mapped domains are not set to force HTTPS connection so there'll be no "security warning" if they are accessed via "http" connection. If you use "https://" the warning will be there until you install a certificate issued for that mapped domain. Furthermore, if the mapped domain goes over HTTPS connection, the original sub-domain should also go over the HTTPS connection, otherwise it would cause "Insecure content" issue.

    Kind regards,
    Adam

  • Dennis

    Adam,

    Here is what I did:

    In Godaddy zone file I made those changes:
    A (host)
    Host @
    Points to my IP

    Did the very same for the domains in my name.com account.

    Godaddy's Cname only allow subdomain but does not permit sub-directories, so I didn't make any changes there, in name.com it's not needed.

    Didn't make any changes in my web host Cpanel.

    When I set it to force https, I got the security warning. As Let's Encrypt does not yet support wildcards, I'll wait and see if they will in coming weeks/months as I think it's on their roadmap to add wildcards.

    I hope this explain what you need to know?

    I have one affiliate site where the site is hosted by the program vendor and I use the very same method to point my domain to the site and it has been like this for some 3 years without any issue. But, it is http.

    Regards
    Dennis

  • Predrag Dubajic

    Hi Dennis,

    I had a look at your site and would like to take step back here if you don't mind.

    I noticed that there are bunch of console errors on your site backend, and they are there even with Domain Mapping deactivated so it's possible that these errors are preventing DM from working properly.

    So can you try disabling all other plugins except DM to see if it works after that, when plugins are disabled please try remapping the domain before checking front end.

    Let us know of the results.

    Best regards,
    Predrag

  • Dennis

    Thanks, Predrag.

    Deactivated or not doesn't matter, the console shows those errors.

    I never checked the primary site in the console until now, (as it didn't have any issues)! It doesn't matter which theme I use, the default wp 2016 or my theme, I still get this error:

    Mixed Content: The page at 'https://mysite.com/' was loaded over HTTPS, but requested an insecure stylesheet 'http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css'. This request has been blocked; the content must be served over HTTPS.

    It might be the root of this issue. As a first step is to fix this and see what happens.

    If you know how this can be fixed, please share it. I will try to search for a solution and see what I come up with.

    Regards
    Dennis

  • Dennis

    I deleted the Let's Encrypt SSL from my server to see if that would change anything - when I delete the mapped domain, the subsite displays just normal, just as it did with or without https when the SSL was active.

    Map the domain and go to the site, all errors in the console are back.

    Failed to load resource: the server responded with a status of 404 (Not Found)

    I don't know what it is, but when the domain is mapped, the site is messed up - doesn't matter if all plugins are activated or deactivated, use wp 2016 theme or my other theme.

    Dennis

  • Dennis

    Well, guys, I think I stumbled upon what's was wrong by coincidence! But only after I found the non-domain mapping plugin solution. Which works just fine if it's a private network not meant to resell sub-sites.

    Dimitris was close to solving the issue!

    Is the issue here that the mapped domain is under SSL and it's trying to get assets (styles & scripts) from non-secure (http://) destinations?

    When the directory structure is changed, it is not possible to use the domain mapping plugin on subdomins or sub-directories because of the code in wp-config which points to the new folder location i.e.

    define( 'WP_CONTENT_DIR', dirname(__FILE__) . '/directory/wp-content' );
    define( 'WP_CONTENT_URL', 'https://your-site.com/directory/wp-content' );

    and use at the same time one SSL Certificate for the whole network, like Let's Encrypt, which do not yet offer wildcard cert.

    As I said above, when I removed the mapped domain, the domain.subsite was ok and error free.

    Regards
    Dennis

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.