When you see this title, you may have two questions: 1, why do you want to define a 404 page, wordpress template is not a 404.php to deal with the page does not exist? What I want to say is that this 404 page is really convenient, but when your site is done for a long time, It is likely to appear a large number of 404 pages, such as the former is to do a Web site for information, when the revised into WordPress blog, there will be a large number of 404 pages, and search engines will continue to visit these non-existent pages, which increased the burden on the server, Using htaccess to customize a static 404 page, you can solve this problem. 2, the use of htaccess custom WordPress 404 page that is not easy, directly in the htaccess file to add code errordocument 404/404.html, and then a new 404.html file uploaded to the root directory on the OK. But this method is not feasible, because the default rewrite rule is to point all the requests to the index.php script, including, of course, nonexistent pages, if you add the normal 404 Page setup code, will not have any effect. Having said so much, I believe you already understand why to customize a 404 page for WordPress. Here's how to customize 404 pages.
1, the first step of course is to create a 404.html file, and upload to the site root directory
2, delete the original rewrite rule file htaccess, add the following rules below.
# BEGIN WordPress errordocument 404/404.html rewriteengine on Rewritebase/rewriterule ^archives/.*$/index.php [L] Rewr Iterule ^feed.*$/index.php [l] rewriterule ^page/.*$/index.php [l] rewritecond%{request_filename}!-f RewriteCond%{REQ Uest_filename}!-d # End WordPress
Archives is the URL format of the article, such as/ARCHIVES/88, can be modified according to their actual article URL. If your blog is installed in the WordPress directory, then you must add Rewriterule ^wordpress/.*$/index.php [L] in the back.
Article Original start: http://www.leicheng.net/use-htaccess-customize-wordpress-404/