I have a django backend and a angular/ui-router frontend. I would like to handle 404 errors (and 400, 403 and 500) on the frontend side. Meaning:
- A client send a bad url (page not found)
- I catch the exception with a custom error handler on the backend side
- Return the 404
- Magic!
- The frontend redirects to something like www.example.com/#/error404
I could just return a django.shortcut.redirect from the backend side but I read here that crawlers from search engines do not like when you do not return a 404 error code on unknown page. With a redirect I'd be returning a 302...
Or is it just wrong to manage error pages on the client side ? This would be a shame because everything is managed by the frontend (header, footer, etc) so the 404 page would not be following the standard page layout.