There are times when the document the user is looking for is not present in our the database, we want to inform them that the document does not exist. We can either redirect them to another page or load another view, which one is appropriate? When to use redirect over view?
Share
Why not return a view with a 404 status code?
Use Redirect if you want to send them to a new part of the site. Perhaps a search page, or the home page.
Use a Not Found View and a 404 status code if you want to inform them the url they have reached is not valid. Also this can be good for SEO. You dont want to be sending a bunch of 302 redirects to Google or it will hit you hard.