Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Redirect to page not found page if the url does't exist in mVC

I need to redirect the user to page not found page if the url doent exist. if the user copy the url and paste it on the rbowser, the page shows page not found method.

in this i need to redirect the user to page not found page

like image 778
nimi Avatar asked Oct 23 '09 09:10

nimi


People also ask

What is the difference between redirect () and RedirectToAction () in MVC?

RedirectToAction is meant for doing 302 redirects within your application and gives you an easier way to work with your route table. Redirect is meant for doing 302 redirects to everything else, specifically external URLs, but you can still redirect within your application, you just have to construct the URLs yourself.


1 Answers

See this:

How can I properly handle 404 in ASP.NET MVC?

which refers to this:

http://blogs.microsoft.co.il/blogs/shay/archive/2009/03/06/real-world-error-hadnling-in-asp-net-mvc-rc2.aspx

like image 168
Palantir Avatar answered Nov 12 '22 11:11

Palantir