How to add 404 error page on asp.net based website?
Updated on September 27, 2018 in General Discussion
6 on September 26, 2018

Hi Friends,

I usually add 404-page create on HTML file like 404.html and add a .htaccess file using this code “ErrorDocument 404 /404.html ” but when I’m trying this code asp.net based website that’s not working.

Is there are any way to add a 404 error page on my website?

I’m trying this code on web.config file but is this not working.

<customErrors mode=”On”>
<error statusCode=”404″ redirect=”404.htm”/>
</customErrors>

  • Liked by
  • Nigetha
Reply
5 on September 26, 2018

Hello ,

I have found a video regarding the 404 error page on asp.net based website. Please check this blog and find a way to rectify this issue.

Member
on September 27, 2018

Thank you, 

I have already known this but in my case, there no Controller files. now I founding a new way I will check and let you know.

Admin
on September 27, 2018

Ok, Great 

If you find any solutions, please don’t forget to let me know. I’m also want to know about that process.

Member
on September 27, 2018

Hi 

Finally, I did. This is the Process for ASP.NET 404-Error Page create
1. Create you Error page 404.aspx Extension File (Like 404.html).
2. Go to Web.Config File and put this code
<system.webServer>
   <httpErrors errorMode=”Custom” existingResponse=”Replace”>
   <remove statusCode=”404″/>
   <error statusCode=”404″ path=”404.aspx” responseMode=”Redirect”/>
   </httpErrors>
<system.webServer>

Admin
on September 27, 2018

Great, Good Job  , Thank you

Member
on September 27, 2018

Thank you
I learned more things to do this.

Show more replies
  • Liked by
Reply
Cancel
Loading more replies