Unfortunately, there is no built-in way to customize the 404 page via FusionAuth themes to force a redirect. The standard theme editor does not include a template for the 404 error page, and this functionality is not currently supported.

The recommended approach is to:

Investigate the root cause: Try to determine what circumstances are causing users to hit the 404 page. If you can replicate the issue, identifying the source will help prevent it from occurring.

Use a reverse proxy: If you need to redirect users away from the 404 page, the recommended solution is to set up a reverse proxy (such as nginx, Apache, or similar) in front of FusionAuth that can intercept 404 responses and redirect users to an appropriate page. For example, with nginx, you can use the proxy_intercept_errors directive to handle error responses.

It's generally better to address why users are reaching the 404 page rather than simply redirecting them away from it, as this may indicate an underlying issue with URL construction, deep linking, or session handling in your application.

Related Documentation Themes Overview - Learn about FusionAuth's theme customization capabilities Troubleshooting Proxies - Important guidance when using FusionAuth behind a reverse proxy 404 Page Theme Forum Discussion - Community discussion confirming this limitation GitHub Issue #404 - Feature request for customizable error pages (consider upvoting if this is important to you)