1 Replies - 3168 Views - Last Post: 30 December 2013 - 07:21 PM

#1 tieugiang94  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 160
  • Joined: 07-December 11

ASP.net MVC 5 and WEb.COnfig ( 404 Error pages)

Posted 11 November 2013 - 07:23 PM

I'm using Visual STudio 2013 to create an ASP .NET MVC 5.
Then I add this code to Web.Config inside the <system.web> sections.


<customErrors mode="On">
<error statusCode="404" redirect="http://google.com"/>
</customErrors>


When I access http://localhost:24079/dasdad.dasd

The website is not redirect to google.com. Why is it ?

I didn't modify anything about C# code. I create an ASP.net MVC project then modify the web.config to add 404 error page

This post has been edited by tieugiang94: 11 November 2013 - 07:40 PM


Is This A Good Question/Topic? 0
  • +

Replies To: ASP.net MVC 5 and WEb.COnfig ( 404 Error pages)

#2 IngeniousHax  Icon User is offline

  • |>|20-514<|{3|2

Reputation: 78
  • View blog
  • Posts: 1,358
  • Joined: 28-March 09

Re: ASP.net MVC 5 and WEb.COnfig ( 404 Error pages)

Posted 30 December 2013 - 07:21 PM

Did you create your custom error handler? You need to have at a minimum an error controller to handle the custom error pages. Should get you started: Custom Error Pages MVC 4
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1