Hello there! As the title says, I’m new to Cloudflare and I’m struggling a bit to connect the service with Google Sites correctly. When adding a custom domain to Google Sites, you can’t configure the page to be located in the top-level domain: it’s always going to be at www.domain.com
. A CNAME record to www targeting ghs.googlehosted.com
was added and it works OK: when accessing www.domain.com
it resolves and you get the website (as long as the proxy status of the record is set to “DNS only”).
What I can’t seem to solve is redirecting domain.com
to www.domain.com
so people can enter any of these URLs and get to the same page.
I’ve searched here on the forum for different solutions but I can’t seem to find one. I’ve already created an A record from “@” to the IPv4 address 192.0.2.0, and added a page rule that fowards domain.com/*
to https://www.domain.com/$1
(301 permanent redirect). Got ERR_NAME_NOT_RESOLVED. I changed the proxy status of the A record to DNS Only, and got timed out.
I’ve even tried replacing the page rule with a redirect rule, as per detailed in other thread: when hostname equals domain.com
, do a dynamic redirect with the expression concat("https://www.domain.com", http.request.uri.path)
(preserve query string ticked). Same result: ERR_NAME_NOT_RESOLVED.
What would you suggest I do? Again, the www page works well, what I’m struggling with is the non-www to www redirect. Please let me know if you need more info