What is first? Read Certificates SSL or Redirects (Page Rules)?

Hi Community.

I want to know from your experience. I have a site integrated with Cloudflare. The site has certificates that allow access only to example.com but not www.example.com. I inspected that the certificate missing another Subject Alt Names DNS with wildcard *.example.com for allowing the access with www.example.com. Can a redirect (page rules) set up from Cloudflare’s admin solve the issue? To set up a redirect 302 from www.example.com to example.com. In other words. Could it work first what the certificates? or the certificates would work first what the redirects? What is the correct flow? (page rules).


I hope your answer soon. Thanks.
Ruben

For starters, you have an invalid certificate there. You need to fix this first.

1 Like

The certificate seems to be the only issue. You need to replace your self-signed certificate with a proper and valid certificate.

1 Like

Page Rules come first. My ‘www’ DNS entries don’t even have a valid IP address, and I use a Page Rule to redirect to the apex domain.

1 Like

Thank you by your help. So Does the page rules come first? or Does the certificates entries first? Can you explain some brief about it. Could you give your opinion about @sdayman ? Is he in the correct? or this apply for other cases? Thanks
Ruben

I am not quite sure what you mean by certificate entires and page rules as these two are completely unrelated.

The only issue here really is the certificate. You have an invalid and broken certificate and need to fix this first. Once that is done, there shouldn’t be any issue, but if there still are we certainly can check those out as well.

1 Like

If you mean by entries the hostnames for which the certificate is valid, then that’s still unrelated to page rules and page rules can’t “fix” that either, but these “entries” are not the issue.

All you need to do is fix the certificate and get a valid one (which can be a Cloudflare Origin certificate as well). That’s it.

Got it. I understand that the certificates and page rules are two things completely unrelated. This make sense for me.

But I want to know the flow or the step by step that uses Cloudflare or the Hosting or the Internet to carry the customer to website. First would comes a layer of certificate and after the layer of the redirecting (managed by the page rules of Cloudflare).

Could you describe briefly it, or the essential?

Thanks
Ruben

Assuming we are talking about an HTTPS connection, then we will first have a TLS connection (with the certificate), then the HTTP layer and in that context page rules. After than anything origin related.

1 Like

Ok, I understood. Yes, we are assuming an HTTPS connection, So after the TLS connection (with the certificate), when it has already established the connection. Then would come the context page rules to work, correct?

Thanks,
Ruben

Correct.

But I can only stress again, your issue here is not related to any of that but because you have a broken certificate on your server and you’ll never be able to establish a secure connection in that. You really need to fix the certificate. Either get a Lets Encrypt certificate or an Origin certificate (the search will have all the details on that).

1 Like

Got it, Thank you. You help is very valuable. Thank you by your patience and your time.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.