404 page not working on Cloudflare pages

I even tried to follow the guide here but it is not working. I have a Jekyll site deployed to Cloudflare pages. Can anyone kindly advise me on how to get the error page to work? My 404.html on the build folder looks like this.

--
layout: page
title: Error 404
sitemap: false
---

<h2>Oops! That page can’t be found.</h2>

I have redesigned my website and removed anything that was either out-of-date or irrelevant to the work I’m doing now, so the page you’re looking for isn’t available anymore.

[Go To The Homepage](/)

Please be more specific. How is it not working?

Have you tried building the site locally to ensure that Jekyll generates a valid 404.html in the output directory?

Any error link redirects to the homepage instead of calling the 404.html file. I use GitHub Desktop to push the file edits from my site folder on my PC to GitHub and then Cloudflare Pages builds and deploys the site. So, I am not sure why this is not working while it works well with Netlify. (I don’t have Jekyll installed locally)

What is your domain?

Summary

I have the file in the root of the build folder (Cloudflare pages strips the .html from URL so returns only /404 ). I use the Github Desktop coz I am not familiar with commands or git. Any way to resolve this with no knowledge of git?

Solved by adding permalink to the error file.

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