Custom domain in cloudflare pags is returning 404

I moved my website to Cloudflare Pages and the setup was seamless. The site is active at https://leftshift-io.pages.dev/

However, when I moved my domain to Cloudflare and tried setting up a custom domain name, the custom domain name does not seem to be working.

The Cloudflare dashboard should that the custom domain is active and SSL is enabled, however when I try to access the page, it returns a 404

Running wget from my local machine and an external servers shows the following

$ wget https://leftshift.io
–2022-05-08 02:59:18-- site_name
Resolving site_name (site_name)… 104.21.53.106, 172.67.212.4
Connecting to site_name (site_name)|104.21.53.106|:443… connected.
HTTP request sent, awaiting response… 404 Not Found
2022-05-08 02:59:18 ERROR 404: Not Found.

If I try to access the http site, it correctly throws a 301 to the https site, but returns a 404 in the end

$ wget http://leftshift.io
–2022-05-08 03:08:52-- site_name
Resolving site_name (site_name)… 172.67.212.4, 104.21.53.106
Connecting to site_name (site_name)|172.67.212.4|:80… connected.
HTTP request sent, awaiting response… 301 Moved Permanently
Location: site_name_with_https [following]
–2022-05-08 03:08:52-- site_name
Connecting to site_name (site_name)|172.67.212.4|:443… connected.
HTTP request sent, awaiting response… 404 Not Found
2022-05-08 03:08:52 ERROR 404: Not Found.

Is there any specific setting that I need to use to get this to work?

The https://leftshift-io.pages.dev/ 404’s for me as well - the custom domain won’t work if the .pages.dev domain doesn’t since all it does is go to the same place.

Are you using the correct build output folder & generating an index.html there?

Ah, thanks, maybe it was just cached for some reason.

I removed the project and rechecked the settings, there were only two
build command - yarn build
build output directory - /build

Updated these and it works!

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