Reason why the IIS custom 404 error cannot take effect

Source: Internet
Author: User

Use the IIS custom error message function to customize the 404 error page.

First, make the htmfile 404.htm (whatever name is used) that displays the error information. I will import the file to the root directory.

Use the URL type and set "/404.htm". It can be defined and displayed, but the returned status is 200.

To return the true 404 status, you can only define the file type, but it does not take effect. The default error page of the original system is displayed.

After exploration and testing, I finally found the reason: I have no permission to access the file.

Because of the server settings, the directory permissions for Web users to access are strictly set. As a result, the system does not have the permission to access the file that defines the error information, so the permission cannot take effect and be displayed.

The following two conditions must be met:

1. Grant the "read" permission for the iis_wpg group to the 404.htm file of the error message.

2.404 page requires that the file size exceed 256 B, that is, the size of more than Chinese characters, otherwise it cannot be displayed normally.

 

Passed the test under win2003 + IIS6.

 

 

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.