Mapped domain redirecting to the main domain

Hi I mapped a domain, but it is redirecting to my main domain instead of the right subsite, it is giving 301 redirect status, but I didn’t create any redirect, only pointed the A record to the IP, can you help me?

  • Adam
    • Support Gorilla

    Hello Sarah

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

    The A record IP doesn’t point currently to your dedicated IP. When I put your dedicated IP into a browser address bar, it loads the main site of your multisite which is fine but the A record of a mapped domain currently points to a different IP which seems to belong to 1&1

    There are two things that must be changed then:

    1. You don’t need the CNAME pointing to a sub-domain in your DNS, only the A record pointing to your IP

    2. The A record for the mapped domain should point to your IP (149.2……98).

    Once these changes are made, you’ll need to wait a bit as DNS needs to propagate across the web. This, unfortunately, can take anything from an hour or two up to 72 hours. Once the DNS is propagated and you add mapping that should work out of the box.

    That said, that’s how it looks “from outside”, based on the screenshots that you shared and DNS checking using external tools. I have accessed your domain DNS configuration though and it’s even a bit more “mixed up”:

    Currently there are two A records in DNS one for the domain and one for its www prefix. The first one points to 1&1 IP and the second one to your IP. If you access the mapped domain over www you’re taking to the main site of your Multisite. Which is expected because there’s no mapped domain currently.

    To sum it up:

    1. edit DNS for the domain on 1&1 be editing the A @ record to point to your IP instead of the current one

    2. remove the current CNAME record

    3. remove the current A www record

    4. add “www” this way:

    – add new CNAME record

    – use www as hostname and @ as value

    5. wait for DNS to propagate

    Once it’s done the domain (both with and without www) should actually load the main site of your Multisite and once it does that login to your site, go to the dashboard of the sub-site you want to map the domain to and in the “Tools -> Domain Mapping” map the domain.

    If any redirects happen after that, let me know and I’ll see what might be causing them and how to fix it.

    Kind regards,

    Adam

  • Sarah
    • Sarah

    Hi Adam,

    I get back to you because I made all the configuration that you told me, but when enter and valid the subsite (on the browser) with http:// so that will redirect on the main site (ProSite page).

    And when we do the same with the https://, we seen an error page (look at the screenshot please) and it still barred (the https).

    Also I mapped the domain but it still invalid statut.

    Could you help me please?

    Regards, Sarah.

  • Adam
    • Support Gorilla

    Hello Sarah

    I checked it again and we seem to be dealing with two separate issues now. One is the main-site/sub-site redirect and one is SSL.

    As for the first one.

    When accessed via https:// the mapped domain does load the proper sub-site so that means that mapping seems to be working. There’s the SSL error (which I’ll explain below) but if you tell the browser to ignore it and accept invalid certificate, the expected site loads.

    I’m not exactly sure though why with http:// it is going to the main site of the multisite. That’s, indeed, a bit surprising as it should also be going to the proper sub-site. This, however, wouldn’t be a DNS issue but rather either something related to site configuration itself or a server-side issue. Unfortunately, the access credentials that you shared via the chat doesn’t seem to be valid anymore and I couldn’t login to the site to check it.

    That being said, could you please enable support access to the site so I could take another look? To do so, please go to the “Network Admin -> WPMU DEV -> Support” page in site’s back-end and click on “Grant support access” button there, then let me know here once it’s done.

    As for SSL error.

    This is a bit different issue and is not actually related to DNS and/or Domain Mapping but rather to how the SSL certification works. The point is: when you try to access any domain over https://, the browser expects to be given an SSL certificate for that domain. The certificate that you seem to have installed on your Multisite is for the main domain only. It’s a wild-card certificate so it will cover the main domain and all its sub-domains (those that already exist and that you will create in future) but any mapped domain is a separate domain.

    There are multiple ways to solve this but it depends on your host and your domain provider which one(s) could be used:

    1. The best one would be to get a certificate for the mapped domain and install it on your server. This might not be possible though if the domain is not “hosted” on that server. Some hosts allow to install multiple certificates “on an IP” but some might require domain to be added as an add-on domain in cPanel first.

    2. If above is not possible, re-configuring the mapped domain to put it through the CloudFlare would be an option – their free plan provides a free SSL certificate that could be used. However, this would mean changing domain DNS configuration again as the domain would have to be directed to CloudFlare first and then the entire A/CNAME record configuration would have to be done there, at CloudFlare

    3. An alternative option, which unfortunately also means huge changes in domain DNS configuration is to actually add the mapped domain to you own server as an add-on domain. In such case DNS settings at provider should be reset to default, domains should be added to your host as add-on domain, the nameservers at domain registrar should be set to those provided by your host and a certificate for that domain should be then installed on your host. Additionally, with such configuration the “root folder” (sometimes referred to as “document root” too; it’s the same, just different name) of the mapped domain should be set to the very same path as current “root folder” for you main domain.

    To sum it up: if your host does allow installing multiple SSL certificates on a single dedicated IP, for the multiple domains that are not even hosted on the server, that should work (though I didn’t try such configuration myself). If they don’t allow it, you’ll need to consider one of the two other solutions explained above (I tested both of them so I can confirm they are working) and apply one of them. Otherwise SSL wouldn’t work for mapped domains and there’d always be a warning.

    Kind regards,

    Adam

  • Sarah
    • Sarah

    Hi Adam,

    I find it fart to understand how can I do for the https.

    So I need first to resolve the issue about the redirection.

    Because as you can seen we cannot access to the domain http even is I mapped it.

    I enabled the support access so that you can see the site configuration.

    Hope you can help soon.

    Regards, Sarah.

  • Adam
    • Support Gorilla

    Hello Sarah

    It seems that the domain is now redirecting to the https as expected. There’s been a slight misconfiguration as the original address – sub-domain coachappi.be…com – had only a “Home” URL set to use “https://” prefix while it should have both “Home” and “Siteurl” URLs set this way. This is something you set on

    “Sites -> All sites -> [click “Edit” for a given site]” page

    It’s now set as it should. I checked with two browser in both regular and incognito mode and in each case I was properly redirected to https:// URL so that seems to be fine now.

    That means that there’s an SSL issue left. Let me try to clarify this a bit for you again and let’s try possible solutions here “step by step”.

    First thing to know is to understand how SSL certification works: an SSL certificate is issued for very specific domains. It’s not that an SSL installed on your server will cover each and every domain that you point to it – the domain name is defined in a certificate and only that domain will be protected.

    Your Multisite is using the “be…com” domain and there is an SSL certificate installed for it already. Additionally, it’s a sub-domain based Multisite meaning that you need so called “wild card” certificate that would protect not only the “be…com” domain but also all its sub-domains (like test.be…com, coachappi.be…com and so on). You already got that so it’s fine. If you weren’t mapping domains to sub-sites, that would be all that you need and no further steps would be necessary.

    However, your sub-site “coachappi.be…com” is using a mapped – additional – domain coachappi.com. Therefore you also need an SSL certificate for that domain. The question is, though, where and how to install it. This is something that depends on the host and on the domain configuration. So, in this case I think you should start with getting in touch with your host support and ask them a question similar to this:

    “I got a dedicated IP and a domain be…com. I already have wild-card certificate for this domain installed and working fine. I have just pointed another domain, coachappi.com, to my IP via a DNS A record. This is working fine too but I need to add SSL certificate for it. Can I somehow install an additional single domain SSL certificate for that domain on my IP, in addition to the one I already have? If so, how can I do this? Or do I have to add the domain to my server as an add-on domain?”

    Something along that line should suffice and they should be able to tell you if (and if so – how) you can add a necessary certificate. Adding it properly would immediately solve the SSL issue without any additional changes. However, if they say that it’s not possible and/or you need to add the domain first as an add-on domain, let me know please and I’ll explain what to do in such case.

    Kind regards,

    Adam

  • Sarah
    • Sarah

    Hi Adam,

    Many thanks for your explanation.

    I had already contact the host about this issue and they give me this answer (but I don’t found where put those code unfortunally) :

    “As it was discussed during the chat, 301 redirect does not also apply the certificate from source site name to the destination one.

    As for configured certificate with forwarding please refer to the following article https://support.plesk.com/hc/en-us/articles/115002672045

    Is that can help?

    Best regards, Sarah.

  • Adam
    • Support Gorilla

    Hello Sarah

    Thank you for getting back to me.

    I’m sorry but I’m confused with this: the 301 redirect has nothing to do with it, there shouldn’t be any redirects set and the “frame forwarding” for the domain is the last thing that should be involved here, it’s an absolute “no go”. Since they referred to this in their response, I admit I’m quite baffled.

    Did you ask them that exact question that I suggested in my last post above and that’s what they responded? Or did you ask them something else, if so – could you tell me what did you ask them exactly, please?

    I’m asking because the response from there that you shared with me is not related to the case and I’m not sure if it’s because of the question or because their support just gave a completely irrelevant answer. I’d like to clear that up for good, if you don’t mind, so we were sure how to proceed. If it won’t be possible to put certificate “through them”, then there are two other options and I’ll need to guide you step by step through them but it would be good to clear this up first.

    Best regards,

    Adam

  • Sarah
    • Sarah

    Hi Adam,

    I get back to you about the SSL certificate.

    The issue was resolved now ! You’re right I don’t ask the right question :slight_smile:

    I installed a free SSl certificate in “coachappi..” to do so I pointed the AAAA record to my IPv6.

    Many thanks for your explanations and your help !! :slight_smile:

    Best Regards, Sarah.