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.