Let me say I have a route/action for showing content pages like this:
/Page/{slug}
where {slug} can be anything that a visitor types in but if left empty it defaults to "Default".
I have my route definition handle the case where {slug} is empty or Default or anything else, so that is setup fine.
Now, what do you do in those cases where the requested slug (e.g. Page) does not exist?
Someone requested /Page/xyz for instance and XYZ does not exist in my datastore.
1) Should I issue 404 (if so, how? My options: a) redirect to default 404 page; b) no 404 response, just a friendly error message?)
2) Should I automatically redirect to default? If so, do I have to issue 302, 301 or what?
I understand this is debatable but still would like some opinions about it on what are the best prectices. Also please provide few lines of code of how would you go implementing it in ASP.NET MVC controller actions.