Custom 404 error page for Linux/IIS server settings

Source: Internet
Author: User
Tags readable
1. Custom 404 error page for Linux virtual host settings

Setting a custom error page allows you to add website records and retain customers who may not be able to open the page. Windows provides custom error page settings for our VM, you can set all custom errors, including the 404 error page. In Linux, manual operations are required.
In Linux, the 404 mode is set through. htaccess file, which is located in the root directory of the website. If your space does not exist, create a new file and upload it to the root directory. Edit the file and add the following line of code.
ErrorDocument 404/404 .html
/404.html is the webpage path used for the error message. Please modify it by yourself
Notes:
1. seo/seo.html "target =" _ blank "> search engine spider crawls to your custom error page. Therefore, set the keyword and link of each column on the website, it is of great help for website recording.
2. It is not recommended to set redirect on custom error pages. Many website creators prefer to add automatic redirect on custom error pages. If you want to redirect, it is recommended to set the redirect to more than 10 seconds, this is because custom jump is likely to be determined by search engines as cheating, resulting in lower weights!
3. Images are generally not recommended for custom error pages. If you need images, do not use too many pages to avoid too many page views, resulting in excessive traffic waste, the stability of the website is not worth the candle.
 
II,WindowsCustom 404 error page for VM instance settings
 
First, create a 404b.htm file and place it in the root directory of your website or another directory. For example, you can create an HttpErrors directory and place it in it. At the same time, a network service read permission is granted to the 404b.htm file. Otherwise, the setting will not take effect.
Then open IIS (Internet Information Service (IIS) manager ):
 
Find the site and click "properties"
Then select "custom error ":
 
Locate the HTTP error, and click "edit" next to 404, 404: 2, 404: 3"
 
Select "file" for the message type ".
Then, right-click the 404 File everyone readable permission, right-click the 404 File -- properties -- security, and add the everyone readable permission, as shown in the figure:
After setting, you can add a non-existent suffix or file name after your site for testing. After setting, your custom error page is displayed.

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.