ASP. NET Custom 404 page

Source: Internet
Author: User

There are many methods on the web, but basically the same, this is just one of the methods, the pro-test is effective, the record may be useful later

1.

First write a 404 page 404.aspx under the project root directory

Then add in the configuration file

 <!--Note This mode, redirectmode default to responseredirect This mode will produce a 302 jump, very unfriendly to the crawler, so we use redirectmode= "Responserewrite" - <customErrorsMode= "On"Redirectmode= "Responserewrite" >      <ErrorStatusCode= "404"redirect= "~/404.aspx"/> </customErrors>

You can now complete the filtering of. aspx.

2. This time we enter ****/demo.html or jump to the 404 page of IIS

To support all the paths

Please enter IIS configuration

So all the paths have been supported

Reference: Http://blog.gkong.com/shotgun_174429.ashx

ASP. NET Custom 404 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.