razorborg essays

Cloudflare and Google Sites Tips

March 17, 2024 by Jan Martin Borgersen

With Google Domains shutting down this year, I am migrating most of my domain hosting to Cloudflare. Cloudflare has a robust offering and they don't charge any markup on registrations. The only downside is that you must use Cloudflare for DNS, but that's only an issue if you are hosting a site somewhere that requires you to use their DNS.

I am hopeful that the migration to SquareSpace will be painless for most people, but I am not interested in paying for website building tools (It's what I do...), so I went looking for other options.

Cloudflare and Google Sites

I am a big fan of Google Sites for standing up simple, quick websites. Sites is especially convenient for small organization websites that need to be managed by non-technical folks. You can leave the Sites file in a shared Google Drive folder, set appropriate sharing permissions, and anyone with the right permissions can edit and re-publish the website. And it's free! The tools are simple and you get a perfectly fine looking website.

I propped up my old Cub Scout Pack site on Google Sites, and I am currently getting the local high school PTSA set up this way.

Getting the Cloudflare DNS settings right is a little bit tricky. Here's what I learned:

Update DNS before transferring the domain

Before transferring a domain to Cloudflare, they require you to update the nameservers on the old registration first, bringing DNS settings to Cloudflare. Here are the steps:

SSL/TLS Encryption: Use Full

DNS Records:

A @ 192.0.2.1 - Proxied
CNAME www ghs.googlehosted.com. - NOT Proxied
TXT for google-site-verification - (see information when adding custom domain)

Redirect Rule: (for redirecting the apex domain to www)

(http.host eq "domain.tld")

Then...

Dynamic Expression

concat("https://www.domain.tld", httprequest.uri.path)

Preserve query string

Then wait!

Give it 15 minutes to an hour for settings to propogate fully. If you are doing this right after transferring your domain, it will take a little time to settle down.