How to set/Configure 404 page in your project.

How to set/Configure 404 page in your project.

This article is for creating 404 page with your website. If there is any error occurred into your live website then end user should not know about this error. They just got the message like "Oops ! Something went wrong. We are working on this. Kindly visit later." 
 
We can create this 404 page using following steps to avoid this type of error are shown to end users.
 
Set 404 page for HTML & other pages
 
Step – 1 : Open Control Panel –> Login –> Click on Website & Domains
Step – 2 : Click on Advanced option –> Virtual Directory
Step – 3 : Click on Error Document tab –> Go to 2 page –> click on 404 link
Step – 4 : Select Type URL, Location : enter full page path. for e.g.(http://www.websitename.com/404.html)
Step – 5 : Click on Ok button to finish 404 page setting.
 
Set 404 page for ASP.net
If your project has we.config file than set 404 page through web.con file.
<customErrors mode="On">
<error statusCode="404" redirect="404.html" />
<error statusCode="500" redirect="error.aspx" />
</customErrors>
 
Follow the below steps if your project not have the web.config file.
 
Step – 1 : Open Control Panel –> Login –> Click on Website & Domains
Step – 2 : Click on Advanced option –> ASP.NET Settings
Step – 3 : Set Custom Error mode = “ON”
Step – 4 : Enter 404 in Status code box and set 404 page(404.html) in Redirect URL box –> Click on +(add) button to set the 404 page.
Step – 5 : Click on Ok button to finish 404 page setting.