Switched to Cloudflare, now root domain name and subdomain do not work

Hi!

I have recently assigned my domain DNS to Cloudflare’s.
My domain “www.joleat.com” works as expected. However, my sub-domain “staging.joleat.com” and “joleat.com” do not, saying that it cannot find my server’s IP address.

Using the Google Dig here: Dig (DNS lookup)
I can see that the domain name answers correctly with the following:
image

I also think that I have setup my DNS records correctly
Also, no workers are setup.

Any help?

Can you post a screenshot of your DNS records at your Cloudflare dashboard?

Maybe you are missing A/AAAA or CNAME records as you have had before?, and they should be pointed to your origin/host.

Moreover, I got redirect error for https://www.joleat.com/.

If missing, here is a great article about how to add them:

Have you had an SSL certificate at your host/origin already installed? Moreover, do you use some CMS like WordPress installed on HTTP or HTTPS at your host/origin before switching the nameservers to Cloudflare ones and setting up the DNS records at Cloudflare DNS dashboard?

Some records are necessary for mail (I use Aruba)

Have you had an SSL certificate at your host/origin already installed?
Yep, SSL is already installted.
Moreover, do you use some CMS like WordPress installed on HTTP or HTTPS at your host/origin before switching the nameservers to Cloudflare ones and setting up the DNS records at Cloudflare DNS dashboard?

My current setup is:
Apache → :80 → http://[www].joleat.com → https://www.joleat.com
Apache → :443 → https://[www].joleat.com

The website uses WordPress as CMS, and yes, it was installed before the DNS record change.

For the redirect error you have show, it is possible that I might have setup a page rule incorrectly. I have just removed it.

1 Like

Kindly, to make your email work make sure each one of A record is :grey: cloud (DNS Only) for the:

  • A mail
  • A mx
  • A smtp
  • A pop3

From the screenshot above the A record for your sub-domain staging is nowhere pointed or you have masked/hide the IP?

Record A staging` should be pointed to your host/origin IP address.

  • Record A www the same thing (Should be pointed to your host/origin IP address)
  • Record A joleat.com the same thing (Should be pointed to your host/origin IP address)

CNAME records, make them :grey: (DNS Only).

Kindly, to make your email work

My e-mail does work fine with these settings, which are also the ones suggested from my current registrar

From the screenshot above the A record for your sub-domain staging is nowhere pointed or you have masked/hide the IP? Should be pointed to your host/origin IP address.

They are masked, they all point to the same IP, which is my current host/origin

The TXT records are masked too

Would mean that yyou have an SSL certificate already installed at your host/origin?
If so, can you please check what SSL option is enabled? Is it Full SSL or any other?

Regarding the redirection, was your WordPress install on HTTP or HTTPS and was it working on which one before you moved to Cloudflare?

How does your Page Rules look like, if so?

Are Always use HTTPS and Automatic HTTPS redirection options enabled at your Cloudflare dashboard?

Other case is where you would also need to rewrite your HTTP to HTTPS at your WordPress database (using either a WordPress plugin like Better Search Replace) - due to possible mixed-content errors which could show up or a redirect loop as currently is showing up.

Nice, but as stated:

Cloudflare’s default configuration only allows proxying of HTTP traffic and will break mail traffic.

Usually the A record that points out to the sub-domain mail.example.com should be :grey: cloud because otherwise your e-mails will not work.

See more details and pointed out the guidelines at the bottom of this page here:

Would mean that yyou have an SSL certificate already installed at your host/origin?

Yes, I have certbot installed, which takes care of my certificate installation

If so, can you please check what SSL option is enabled? Is it Full SSL or any other?

In the SSL/TLS option page, I have the Flexible option enabled.

Regarding the redirection, was your WordPress install on HTTP or HTTPS and was it working on which one before you moved to Cloudflare?

My WordPress install hasn’t changed from before. The only change I have made was to use Cloudflare DNS instead of Aruba DNS, and every route was working as intended before. The installation was on HTTPS.

Are Always use HTTPS and Automatic HTTPS redirection options enabled at your Cloudflare dashboard?

Both of those options are disabled in the CF dashboard.

Other case is where you would also need to rewrite your HTTP to HTTPS at your WordPress database

I don’t have any HTTPS problems, everything is running ok in that front, and I have no problems of mixed-content.

Kindly, switch it to Full SSL due to:

Can you try to enable them?

But there is still to fix the ERR_TOO_MANY_REDIRECTS error showing up.

Also to consider the SSL for WordPress administration dashboard:

But there is still to fix the ERR_TOO_MANY_REDIRECTS error showing up.

First of all, thank you for your time, but my original query regards unreachable subdomains, not about WordPress configuration or HTTPS problems, which can and will be resolved later.

So far, I have made the DNS changes you have suggested, to no avail.

Now when I visit staging.joleat.com it asks me for 401 authorization code. Is that ok or? Also as I see it is proxied by Cloudflare.

Now when I visit staging.joleat.com it asks me for 401 authorization code. Is that ok or?

That is an expected behavior.

Although, I am not able to reach it, and some other clients are not able as well.

1 Like

The changes have now evolved!
Now also www.joleat.com does not work for me ^^"

joleat resolves to me and redirects to WWW which loads correctly at me:

Staging sub-domain also working:

Can you try to clear browser cache or try in another Web browser?

1 Like

The plot thickens. Using cURL to directly call Coudflare’s IP with my hostname appears to work fine, but calling it directly does not work.

Still, me and other people are not able to access the website, so now I am out of options

Can you try to clear browser cache or try in another Web browser?

I have tried on my phone, with the same Wi-Fi connection, and I have the same result. Switching to 4G connection works

Now my DNS configuration looks like this. I have switched to Full (strict) SSL/TLS, and installed the Cloduflare certificate on the server.

As you suggested, I have tried another browser, too:


But the error is the exact same.

You mean you just installed Cloudflare Origin CA certificate? Not needed to if you already have had Certbot’s SSL certificate as already stated from above.

I can confirm I still see the same result, both site and sub-domain working from my end.

Not needed to if you already have had Certbot’s SSL certificate as already stated from above.

Indeed, I have switched back to using the previous cert.

I will give it 48h to see if the propagation works. For now, I have set my PC’s DNS to use Google’s 8.8.8.8 and 8.8.4.4 (I was using Cloudflare’s previously, 1.1.1.1 and 1.0.0.1), and it works fine.

The error still occurs on some devices for some other clients unfortunately.

1 Like

Regarding the previous cert - okay.

Regarding the propagation, yes, obviously we should wait for some more time due to recent changes.

Until we wait, maybe some other people would like to help and check from their end and reply here on the topic regarding the further issues, if so.

1 Like