I recently took control of a site hosted here and would like to switch the DNS over to Cloudflare. My records imported and I have a CNAME that points to my Hubspot URL. I'm wondering about best practices but specifically how the 301 redirect from the root domain is handled. The CNAME record for www does not allow it to be "orange clouded" which is required for you to set up a page rule in Cloudflare that will allow you to 301 the root to www. Right now, we have an A record set up that is useless that simply allows us to use a page rule on the root domain. I was hoping a flattened CNAME could be used. Does anyone have any experience or best practices with using Cloudflare and Hubspot? Thanks in advance!
Because of this, the CNAME cannot be orange clouded which turns on the HTTP proxy in Cloudflare.
Based on my experience, you cannot use the root domain in HubSpot. Plus, HubSpot cannot automatically redirect your root domain to the www version. As you mentioned, you've to leverage the Cloudflare page rules. Here's the HubSpot guide to set up your CNAME & redirection.
This is what I do:
Set up A record in Cloudflare
Set up CNAME that points to HubSpot
Set up Page Rules in Cloudflare for 301 redirection
I'd suggest using both http & https version redirected to https://www version; Now Cloudflare will resolve both http & https for you and redirect you to the https version of your www site.
Based on my experience, you cannot use the root domain in HubSpot. Plus, HubSpot cannot automatically redirect your root domain to the www version. As you mentioned, you've to leverage the Cloudflare page rules. Here's the HubSpot guide to set up your CNAME & redirection.
This is what I do:
Set up A record in Cloudflare
Set up CNAME that points to HubSpot
Set up Page Rules in Cloudflare for 301 redirection
I'd suggest using both http & https version redirected to https://www version; Now Cloudflare will resolve both http & https for you and redirect you to the https version of your www site.
How do you leverage Cloudflare page rules when the CNAME can't be proxied through cloudflare? It only allows the option of `DNS only` under Proxy Status.
Is the reason your cname cannot be proxied because you don't have an A record for your root domain? If that is the case, enter a dummy A record and then use the page rules to do your redirect. Not elegant but it is what I had to do.
I have an A record for the root domain. I set it up using the instructions below:
You also have to add the CNAME for `www` that points to `
XXX.groupXXX.sites.hubspot.net`. This CNAME is not allowed to be proxied through cloudflare so when a request comes in for `www.example.com`, it doesn't take advantage of any page rules or workers.
Thanks a lot. Just in case anyone has a question later as to what A record to use. It doesn't matter what A record that you use. The page rule will override it and redirect it to the WWW CNAME record.
I was not involved directly in the configuration so, unfortunatly, I do not have any more detailed information to share, but hopefully this points you in the right direction.
>>I recently took control of a site hosted here and would like to switch the DNS over to Cloudflare.
As you probably already know, HubSpot runs on Amaz0n Web Services (AWS) in the United States East region, and HubSpot leverages the Google Cloud Platform (GCP) in the EU (Frankfurt, Germany region).
Not even certain it's possible to move a HubSpot hosted site to another CDN. Obviously, doing so we'd expect to lose any infrastructure security protections offered by HubSpot's CDN including DDoS Attack mitigation and Web Application Firewall. Also we'd expect to lose HubSpot's 99.999% uptime SLA.
Seems like a lot to pay for and not use. In fact, it's one of the primary reasons we recommend HubSpot to clients for blogging over WordPress! All of the headaches that come with a 'free', open source platform are eliminated (to the extent possible) when using HubSpot.
Best bet is to reach out to your Customer Success Manager.
Note: Please search for recent posts as HubSpot evolves to be the #1 CRM platform of choice world-wide.
Thanks for the reply Frank! Our intention was to use cloudflare to manage the DNS only instead of GoDaddy since that is where we control other domains. You can use cloudflare without using their CDN. And from some of the only other info I found about Cloudflare and Hubspot, Hubspot uses them for their CDN and SSL certificates.
Ahh. I see what you're trying to do. Can't say we've seen this before, but your CSM should be able to direct you to the correct HubSpot Infrastructure people. They'd be able to tell you immediately.
Would be interested in knowing how it turns out.
Note: Please search for recent posts as HubSpot evolves to be the #1 CRM platform of choice world-wide.