Cannot get Obsidian publish to work with a custom domain

What I’m trying to do

Make my own domain work with Publish mydomain(dot)com not www(dot)mydomain(dot)com (that should redirect to mydomain(dot)com)

I followed all the instructions. I have received nothing but errors and problems out of Cloudflare and they don’t offer support unless you get a $20 per month account (2.5x the cost of Publish itself).

Things I have tried

I followed the instructions exactly.

Cloudflare has a warning indicating a CNAME should not be used for a a root domain (domain(dot)com vs. subdomain(dot)domain(dot)com) but there is no clear alternative option. I don’t want www(dot)domain(dot)com I want domain(dot)com for my default site. CNAME flattening · Cloudflare DNS docs

Is there a mistake in the instructions? help.obsidian.md/Obsidian+Publish/Set+up+a+custom+domain

My settings:

Screenshot 2024-01-23 at 3.15.31 PM

After waiting the entire day for this to start resolving now it resolves but there is a redirect error

The page isn’t redirecting properly

An error occurred during a connection to domain.com.

This problem can sometimes be caused by disabling or refusing to accept cookies.
The page isn’t redirecting properly

An error occurred during a connection to www.domain.com.

This problem can sometimes be caused by disabling or refusing to accept cookies.

It doesn’t work with the page rule active or disabled

Others had the exact same problem two years ago and it’s still a problem. Where is the documentation and the solution? Setting up a custom domain for Obsidian Publish is a nightmare. Isn’t this supposed to be easy?

“EDIT: I deleted the CNAME and re-added it, then set my certificate to flexible then changed it back to full and now it works! Spent an hour trying to fix this, and it took all of 10 seconds to fix it. I have no idea what happened though.” @oash

This worked for me too, missed the solution on first read, although I also toggled it “off” before before “flexible”.

After doing that and renabling the page rule as above everything started working within 15-20 minutes. It’s not clear if this is a Cloudflare problem or an Obsidian problem but this turned a 5 minute job into an hours long nightmare.

For anyone else stumbling on this post:

I followed the instructions for setting up a custom domain but got an ERR_NAME_NOT_RESOLVED error in the browser.

The error indicates that for whatever reason my computer can’t connect to Cloudflare, i.e. due to firewall or ISP restrictions, as per this answer on Cloudflare forums.

Surely enough, the domain worked just fine after I switched networks (i.e. turned on VPN or used mobile data instead of WiFi).