How to return a proper 404 response for a 404 page (node)

If you want full control over the 404 route just add a middleware as explained here:

Instead of exports you can use exports.after and it will load the route after all the other ones.

Also you could make a redirect to a predefined 404 route from your SC workflow.

You could also create a custom module to send a 404 response directly.

1 Like