404 errors are errors that are prone to the WWW site access. The most common error hint: 404 Not FOUND. 404 error page settings on the site SEO has a great impact, and improper settings, such as direct to jump home, etc., will be the search engine down the right to pull hair. 404 The purpose of the page should be to tell the user: the page you requested is not there, and also guide the user to browse the site other pages instead of closing the window to leave. The search engine uses the HTTP status code to identify the state of the page. When the search engine gets a bad link, the site should return a 404 status code that tells the search engine to discard the index of the link. If a 200 or 302 status code is returned, the search engine will index the link, resulting in a number of different links pointing to the same page content. As a result, search engines have significantly reduced trust in websites.
Here is the LNMP setting nginx 404 error page Tutorial:
1, vi/usr/local/nginx/conf/nginx.conf edit nginx configuration file, add the following code in the HTTP section:
Fastcgi_intercept_errors on;
650) this.width=650; "alt=" 1.jpg "src=" http://www.sjyhome.com/uploadfile/2013/1005/20131005013348212.jpg "style=" margin:0px;padding:0px; "/>
2, edit the website configuration file, such as this site: vi/usr/local/nginx/conf/vhost/onelone.com.conf, add the following code in the server section:
Error_page 404 =/404.html;
Note: A netizen testing the uplink code needs to remove the equal sign to return the correct 404 state, so please test whether you want to remove the equal sign.
650) this.width=650; "alt=" 2.jpg "src=" http://www.sjyhome.com/uploadfile/2013/1005/20131005013348918.jpg "style=" Margin:0px;padding:0px;border:none; "/>
3, test the configuration file is correct:/usr/local/nginx/sbin/nginx-t, return the following code through:
The configuration file/usr/local/nginx/conf/nginx.conf syntax is okconfiguration file/usr/local/nginx/conf/ Nginx.conf Test is successful
4, restart LNMP effective:/root/lnmp restart.
650) this.width=650; "alt=" 3.jpg "src=" http://www.sjyhome.com/uploadfile/2013/1005/20131005013348949.jpg "style=" Margin:0px;padding:0px;border:none; "/>
5, 404 error page Production considerations:
Do not turn 404 errors to the website homepage, which may cause the homepage to be lowered or disappeared in the search engine
Do not use absolute URLs, if the status code returned using an absolute URL is 302+200, this results in a large number of duplicate pages.
404 Page Setup is complete, be sure to check that it is correct. The HTTP header information returned must be 404 states. This can be checked by the Server Head Information check tool.
404 page do not automatically jump, let the user to determine the whereabouts.
The custom 404 page must be greater than 512 bytes, otherwise the IE default 404 page may appear.
Welcome reprint, but please keep the original address http://www.sjyhome.com/nginx/nx-404.html
Nginx How to set the custom 404 page