: This article mainly introduces the Nginx custom 404 page (configured in Linux). If you are interested in the PHP Tutorial, refer to it. 404 error is an easy-to-see error during WWW website access.
The most common error message is 404 not found. The setting of the 404 error page has a great impact on the SEO of the website. improper setting, such as directly switching to the home page, will be de-authorized by the search engine. 404 the purpose of the page should be to tell the user that the page you requested does not exist. at the same time, the user is guided to browse other pages of the website rather than closing the window and leaving. The search engine uses HTTP status codes to identify the status of webpages. When the search engine gets an error link, the website should return a 404 status code, telling the search engine to discard the index of the link. If a 200 or 302 status code is returned, the search engine creates an index for the link, which leads to a large number of different links pointing to the same webpage content. As a result, the search engine's trust in the website is greatly reduced.
First open the nginx. conf filefastcgi_temp_file_write_size 128k;
Add
fastcgi_intercept_errors on;
(Note, including;
Number)
Then in the site to be defined (the author's file is/alidata/server/nginx/conf/vhosts
Directory)
Inroot /alidata/www/lbinin;
Adderror_page 404 = /404.html;
(/404.html puts the custom 404.html under the root directory of the server)
Similarly, to add the 403 page, the code is:error_page 403 = /403.html;
Save and restart nginx.
Start, stop, and restart nginx in Linux
/etc/init.d/nginx start/stop/restart/reload
For example, start nginx:
/etc/init.d/nginx start
'). AddClass ('pre-numbering '). hide (); $ (this ). addClass ('Has-numbering '). parent (). append ($ numbering); for (I = 1; I <= lines; I ++) {$ numbering. append ($ ('
'). Text (I) ;}; $ numbering. fadeIn (1700) ;}) ;}; script
The above introduces the Nginx custom 404 page (configuration in Linux environment), including some content, hope to be helpful to friends who are interested in PHP tutorials.