\u4e8c\u3001\u865a\u62df\u4e3b\u673a\u4f2a\u9759\u6001\u89c4\u5219<\/strong><\/p>\n\u4fee\u6539WordPress\u56fa\u5b9a\u94fe\u63a5\u4f2a\u9759\u6001\u5316\u540e\uff0c\u7f51\u9875\u5374\u6253\u4e0d\u5f00\uff0c\u51fa\u73b0\u8fd9\u79cd\u60c5\u51b5\u8fd9\u662f\u56e0\u4e3a\u7f3a\u5c11\u4f2a\u9759\u6001\u89c4\u5219\u3002<\/p>\n
WordPress\u56fa\u5b9a\u94fe\u63a5\u4f2a\u9759\u6001\u5316\u8bbe\u7f6e\u89c4\u5219\uff0c\u662f\u6839\u636e\u4f60\u4e3b\u673a\u73af\u5883\u6765\u51b3\u5b9a\u7684\uff0c\u4e0d\u9700\u8981\u63d2\u4ef6\uff0c\u7f51\u4e0a\u8fd0\u884c\u7684wordpress\u65e0\u975eIIS\/Apache\/Nginx\u8fd9\u4e09\u79cd\u73af\u5883\u3002<\/p>\n
WordPress\u56fa\u5b9a\u94fe\u63a5\u4f2a\u9759\u6001\u5316\u8bbe\u7f6e\u6280\u5de7\u591a\u79cd\u591a\u6837\uff0c\u9700\u8981\u5bf9\u53f7\u5165\u5ea7\u3002\u5982\u679c\u4f7f\u7528\u7684\u662f\u865a\u62df\u4e3b\u673a\uff0c\u5927\u591a\u6570\u7684IDC\u670d\u52a1\u5546\uff0c\u90fd\u652f\u6301wordpress\u4f2a\u9759\u6001\uff0c\u76f4\u63a5\u5728\u540e\u53f0\u4fee\u6539\u56fa\u5b9a\u94fe\u63a5\u8bbe\u7f6e\u5373\u53ef\u3002<\/p>\n
1\u3001Linux\u670d\u52a1\u5668\u73af\u5883<\/p>\n
\u8bf7\u786e\u4fdd\u4f60\u7684\u6839\u76ee\u5f55\u5f00\u542f\u4e86777\u6743\u9650\uff0c\u5df2\u5f00\u542f\u7684\u8bdd\uff0c\u5728\u4fee\u6539\u81ea\u5b9a\u4e49\u56fa\u5b9a\u94fe\u63a5\u540e\u7684\u77ac\u95f4\uff0c\u4f1a\u5728\u4e3b\u673a\u6839\u76ee\u5f55\u81ea\u52a8\u751f\u6210\u4e00\u4e2a.htaccess\u7684\u6587\u4ef6\uff0c\u6253\u5f00\u67e5\u770b\u662f\u5426\u5df2\u751f\u6210\u89c4\u5219\uff0c\u751f\u6210\u7684\u8bdd\uff0c\u5c31OK\u4e86\uff0c\u5c31\u4e0d\u9700\u8981\u5f80\u4e0b\u770b\u4e86\u3002<\/p>\n
\u5982\u679c\u6ca1\u6709\u751f\u6210.htaccess\uff0c\u6216\u8005.htaccess\u91cc\u6ca1\u6709\u5185\u5bb9\uff0c\u90a3\u5c31\u9700\u8981\u624b\u52a8\u521b\u5efa\u4e00\u4e2atxt\u6587\u4ef6\uff0c\u4f7f\u7528\u4e0a\u4f20\u8f6f\u4ef6\u4fee\u6539\u540d\u4e3a .htaccess\uff0c\u7c98\u8d34Apache\u6216Nginx\u89c4\u5219\u4ee3\u7801\uff0c\u4fdd\u5b58\u5e76\u4e0a\u4f20\u5230\u7f51\u7ad9\u6839\u76ee\u5f55\u5c31\u884c\u4e86\u3002<\/p>\n
Apache\u89c4\u5219<\/p>\n
<IfModule\u00a0mod_rewrite.c>\r\n\r\nRewriteEngine\u00a0On\r\n\r\nRewriteBase\u00a0\/\r\n\r\nRewriteRule\u00a0^index\\.php$\u00a0-\u00a0[L]\r\n\r\nRewriteCond\u00a0%{REQUEST_FILENAME}\u00a0!-f\r\n\r\nRewriteCond\u00a0%{REQUEST_FILENAME}\u00a0!-d\r\n\r\nRewriteRule\u00a0.\u00a0\/index.php\u00a0[L]\r\n\r\n<\/IfModule><\/code><\/pre>\n <\/p>\n
Nginx\u89c4\u5219<\/p>\n
location\u00a0\/\u00a0{\r\n\r\nif\u00a0(-f\u00a0$request_filename\/index.html){\r\n\r\nrewrite\u00a0(.*)\u00a0$1\/index.html\u00a0break;\r\n\r\n}\r\n\r\nif\u00a0(-f\u00a0$request_filename\/index.php){\r\n\r\nrewrite\u00a0(.*)\u00a0$1\/index.php;\r\n\r\n}\r\n\r\nif\u00a0(!-f\u00a0$request_filename){\r\n\r\nrewrite\u00a0(.*)\u00a0\/index.php;\r\n\r\n}\r\n\r\n}<\/code><\/pre>\n2\u3001Windows\u4e3b\u673aIIS\u73af\u5883\u4e0b\u4f2a\u9759\u6001\u89c4\u5219<\/p>\n
\u4f60\u4f7f\u7528\u7684windows\u4e3b\u673a\u5fc5\u987b\u5b89\u88c5\u4e86\u88c5Rewrite \u7ec4\u4ef6\u624d\u80fd\u652f\u6301\u4f2a\u9759\u6001\uff0c\u54a8\u8be2\u4e0b\u4f60\u7684\u4e3b\u673a\u5546\u6240\u4f7f\u7528\u7684\u4e3b\u673a\u662f\u5426\u652f\u6301\u4f2a\u9759\u6001\uff0c\u652f\u6301\u7684\u8bdd\u8bf7\u7ee7\u7eed\u5f80\u4e0b\u770b\u3002<\/p>\n
\u5982\u679c\u4e3b\u673a\u652f\u6301\u4f2a\u9759\u6001\uff0c\u5728\u4fee\u6539wordpress\u56fa\u5b9a\u94fe\u63a5\u540e\u65e0\u6cd5\u4f2a\u9759\u6001\uff0c\u5728\u6839\u76ee\u5f55\u81ea\u52a8\u751f\u6210\u4e00\u4e2ahttpd.ini\uff0c\u6ca1\u6709\u751f\u6210\u7684\u8bdd\uff0c\u5c31\u521b\u5efa\u4e00\u4e2atxt\u6587\u672c\uff0c\u4fee\u6539\u540d\u5b57\u4e3ahttpd.ini\uff0c\u590d\u5236\u7c98\u8d34\u4e0b\u8fb9\u4ee3\u7801\uff0c\u4fdd\u5b58\u4e0a\u4f20\u5230\u6839\u76ee\u5f55\u3002<\/p>\n
[ISAPI_Rewrite]\r\n\r\n#\u00a0Defend\u00a0your\u00a0computer\u00a0from\u00a0some\u00a0worm\u00a0attacks\r\n\r\n#RewriteRule\u00a0.*(?:global.asa|default\\.ida|root\\.exe|\\.\\.).*\u00a0.\u00a0[F,I,O]\r\n\r\n#\u00a03600\u00a0=\u00a01\u00a0hour\r\n\r\nCacheClockRate\u00a03600\r\n\r\nRepeatLimit\u00a032\r\n\r\n#\u00a0Protect\u00a0httpd.ini\u00a0and\u00a0httpd.parse.errors\u00a0files\r\n\r\n#\u00a0from\u00a0accessing\u00a0through\u00a0HTTP\r\n\r\n#\u00a0Rules\u00a0to\u00a0ensure\u00a0that\u00a0normal\u00a0content\u00a0gets\u00a0through\r\n\r\nRewriteRule\u00a0\/tag\/(.*)\u00a0\/index\\.php\\?tag=$1\r\n\r\nRewriteRule\u00a0\/software-files\/(.*)\u00a0\/software-files\/$1\u00a0[L]\r\n\r\nRewriteRule\u00a0\/images\/(.*)\u00a0\/images\/$1\u00a0[L]\r\n\r\nRewriteRule\u00a0\/sitemap.xml\u00a0\/sitemap.xml\u00a0[L]\r\n\r\nRewriteRule\u00a0\/favicon.ico\u00a0\/favicon.ico\u00a0[L]\r\n\r\n#\u00a0For\u00a0file-based\u00a0wordpress\u00a0content\u00a0(i.e.\u00a0theme),\u00a0admin,\u00a0etc.\r\n\r\nRewriteRule\u00a0\/wp-(.*)\u00a0\/wp-$1\u00a0[L]\r\n\r\n#\u00a0For\u00a0normal\u00a0wordpress\u00a0content,\u00a0via\u00a0index.php\r\n\r\nRewriteRule\u00a0^\/$\u00a0\/index.php\u00a0[L]\r\n\r\nRewriteRule\u00a0\/(.*)\u00a0\/index.php\/$1\u00a0[L]<\/code><\/pre>\n <\/p>\n
PS\uff1a<\/p>\n
\u5982\u679c\u4f60\u4e0d\u77e5\u9053\u6240\u4f7f\u7528\u7684\u4e3b\u673a\u662f\u4ec0\u4e48\u7cfb\u7edf\uff0c\u6216\u4f7f\u7528\u7684Linux\u6216Windows\u7cfb\u7edf\u7684VPS\u4e3b\u673a\uff0c\u4e0d\u4f1a\u914d\u7f6e\u4f2a\u9759\u6001\u89c4\u5219\uff0c\u53ef\u4ee5\u54a8\u8be2\u4f60\u7684\u7a7a\u95f4\u5546\uff0c\u4ed6\u4eec\u4f1a\u5e2e\u52a9\u4f60\u5b9e\u73b0wordpress\u4f2a\u9759\u6001\uff0c\u867d\u7136\u8bbe\u7f6e\u4e86\u4f2a\u9759\u6001\uff0c\u53ea\u662f\u5c55\u793a\u7684\u4f2a\u9759\u6001\u540e\u7f00\uff0c\u5176\u5b9e\u8fd8\u662f\u52a8\u6001\u9875\u9762\uff0c\u5982\u679c\u60f3\u5b8c\u5168\u9759\u6001\u9875\u9762\uff0c\u53ef\u4ee5\u5b89\u88c5WP Super Cache\u6216\u8005Hyper Cache\u63d2\u4ef6\uff0c\u4e3a\u5168\u7ad9\u751f\u6210\u9759\u6001\u9875\u9762\u7f13\u5b58\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"
\u8bbe\u7f6e\u6210\u529f\u7684\u524d\u63d0\u662f\u4f60\u7684\u7a7a\u95f4\u5fc5\u987b\u652f\u6301\u4f2a\u9759\u6001\u3002 \u521a\u5b89\u88c5\u7684WordPress\u7684\u6240\u6709\u7f51\u9875\uff0c\u90fd\u5e26\u201c\u95ee\u53f7\u201d\u7684PHP\u52a8\u6001\u94fe\u63a5\uff0c […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[5,358],"class_list":["post-94","post","type-post","status-publish","format-standard","hentry","category-web","tag-wordpress","tag-358"],"_links":{"self":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/posts\/94","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/comments?post=94"}],"version-history":[{"count":0,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/posts\/94\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/media?parent=94"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/categories?post=94"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/tags?post=94"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}