windows, linux system 404 setup tutorial (applicable to virtual hosting)
Published: 2014-12-24
Setting up a good custom error page can increase the website's indexing and retain some customers who might give up because pages cannot be opened. Our virtual hosting specifically provides custom error page settings, and all custom errors, including 404 errors, can be configured.
linux system setup method:
Step 1: Create a text file locally and add the following statement in the text:
ErrorDocument 404 /404.html
Then upload it to wwwroot and rename it to .htaccess. If this file already exists in the website directory, download it, open it with an editor, and add the above rule.
Step 2: Upload your own 404 prompt file and rename it to 404.html; you can also use other extensions, as long as the same file is specified in .htaccess, for example ErrorDocument 404 /404.php
Note: The pseudo-static rules built into some programs may conflict with 404. If this happens, you can only contact the program provider to debug the pseudo-static rules.
windows system setup method:
First, open our company's website, enter your username and password to log in to the management center, click "Business Management" -- "Virtual Host Management" on the left, then select your virtual host on the right and click "Manage"
On the virtual host management panel, click "Error Page Definition" to enter the custom error settings.

In "Error Page Definition", click "Set Custom Errors"; the system will generate an HttpErrors directory under your wwwroot directory and copy all error pages to this directory. You only need to download the corresponding page, modify it, and upload it again.

The 404 prompt page path in windows2003 system is the file wwwroot/HttpErrors/404b.htm; you only need to modify the file 404b.htm to the prompt content you want. The 404 file name in windows2008 system is wwwroot/HttpErrors/404.htm
Note: The "Set Custom Errors" function returns status code 200. If you need to return the 404 status code, please use the following methods to solve it:
1. Click "Set Dynamic 404 Page" and specify the static 404 page you designed, such as 404.html; the returned status code will be 404.
2. If the 404 page is dynamic, such as 404.php or 404.asp, you need to add the corresponding status code to the header of these dynamic web pages:
Add for asp: <%Response.Status="404 Moved Permanently"%>
Add for php: <?php header("HTTP/1.0 404 Not Found")?>
Then in "Set Dynamic 404 Page", specify the dynamic 404 page.
Appendix: url status code online checking tool
