Create a 404 redirect to server on cloudflare

Please show me the detailed formula on how to create a redirect command.
Redirect all 404s to the homepage by cloudflare rule.

You can’t do that with a redirect rule, as it doesn’t care about the response. You would have to use a worker to check the response code and then return a redirect if it is a 404.


Or in your 404 page you could add HTML to set the location

<meta http-equiv="Refresh" content="0; url=''" />
<script>window.location.href = ''</script>

1 Like

thanks so much.

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