ASP. 404 error jump to specified page

Source: Internet
Author: User

Three ways to share an ASP. 404 error jump to a specified page

Method one: Web. config configuration
  1. 1 First double-click the "Web. config" file in the Open project

  

Find the system.web node, add mode on the CustomErrors node, and replace the "404.html" in the diagram with the file path name you need, (if not, please add it manually, the code has smart tips, it is easy to add)

  

Once recompiled, it jumps to the specified page.

  

Method Two: Global.asax configuration

Also found in the project and double-click to open the "Global.asax" file

  

Adding code to the "Application_Error" method also requires recompiling to see the effect, Step 3 of the reference method

  

  

Method Three: IIS configuration

Open your "IIS Manager", right click on your website project, find the "Properties" menu in the popup right-click menu, we take "WebClient" project as an example

  

The Properties window for the WebClient project pops up, finds and opens the Custom Errors tab, finds "404" in the HTTP error message list, and then clicks the Edit button

  

In the "Edit Custom Error Properties" window that pops up in the "File" input box, modify the file path name you need, then click OK button to finish setting, then restart the IIS service to see the effect

ASP. 404 error jump to specified page

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.