How to redirect user to a 404 page on Cloudflare pages, when user visit a non exist

For Workes & Pages, what is the name of the domain?

sample.com/aaaaaa

What is the issue or error you’re encountering

how to redirect user to a 404 page on Cloudflare pages, when user visit a non exist path

What steps have you taken to resolve the issue?

how to redirect user to a 404 page on Cloudflare pages, when user visit a non exist path.
it seems the _redirects does not support this feature.
sample.com/aaaaaa
will return the same result as
sample.com

Make a 404.html

3 Likes

do you mean cloudflare will automatically redirect non-exist path to 404.html?

Yes, see the doc linked.

2 Likes

mate, this is insanely fast response, and im sorry that i didn’t read the doc carefully!
thank you so much on the quick response.

1 Like

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