{"id":1445,"date":"2018-04-06T07:27:44","date_gmt":"2018-04-05T23:27:44","guid":{"rendered":"http:\/\/www.woniuseo.com\/?p=1445"},"modified":"2018-07-26T18:48:10","modified_gmt":"2018-07-26T10:48:10","slug":"wordpress%e5%a6%82%e4%bd%95%e8%b7%af%e5%be%84%e4%bc%aa%e9%9d%99%e6%80%81%e5%a4%84%e7%90%86","status":"publish","type":"post","link":"http:\/\/www.woniuseo.com\/1445.html","title":{"rendered":"wordpress\u5982\u4f55\u8def\u5f84\u4f2a\u9759\u6001\u5904\u7406"},"content":{"rendered":"

\u4e00\u76f4\u4ee5\u6765\u5f88\u591a\u540c\u5b66\u5b66\u4e86\u8def\u5f84\u4f18\u5316\uff0c\u603b\u662f\u7ea0\u7ed3\u7f51\u7ad9\u5982\u4f55\u505a\u4f2a\u9759\u6001\u5904\u7406\uff0c\u4eca\u5929\u6211\u6765\u5206\u4eabwordpress\u5982\u4f55\u8def\u5f84\u4f2a\u9759\u6001\u5904\u7406\uff1b\uff08\u672c\u5730\u7f51\u7ad9\u4e3a\u4f8b\uff09<\/p>\n

\"wordpress\u5982\u4f55\u8def\u5f84\u4f2a\u9759\u6001\u5904\u7406\"<\/a><\/p>\n

\u6ca1\u5904\u7406\u4e4b\u524d \u57fa\u672c\u8def\u5f84\u50cf\u8fd9\u79cd\uff1ahttp:\/\/www.woniuseo.com\/?p=905<\/p>\n

\"wordpress\u5982\u4f55\u8def\u5f84\u4f2a\u9759\u6001\u5904\u7406\"<\/a><\/p>\n

 <\/p>\n

\u5904\u7406\u65b9\u6cd5\uff1a<\/p>\n

\u7b2c\u4e00\u79cd\uff1a\u8bbe\u7f6e-\u56fa\u5b9a\u94fe\u63a5-\u81ea\u5b9a\u4e49\u7ed3\u6784\uff08\u540e\u9762\u52a0\u4e0a\uff1a\/%post_id%.html\uff09<\/p>\n

\"\u7f51\u7ad9\u4f2a\u9759\u6001\u5904\u7406\"<\/a><\/p>\n

\u4fdd\u5b58\u4e4b\u540e\uff0c\u6211\u4eec\u518d\u6765\u770b\u4e0b\uff1a<\/p>\n

\"wordpress\u5982\u4f55\u8def\u5f84\u4f2a\u9759\u6001\u5904\u7406\"<\/a><\/p>\n

 <\/p>\n

\u8fd9\u6837\u5c31\u6210\u529f\u4e86 \u00a0\u662f\u4e0d\u662f\u5f88\u7b80\u5355\u5462\uff01<\/p>\n

 <\/p>\n

\u6ce8\u610f\uff1a\u5f53\u7136\uff0c\u6bcf\u79cd\u7a7a\u95f4\u73af\u5883\u4e0d\u4e00\u6837\uff0c\u90a3\u4e48\u4e0d\u4e00\u5b9a100%\u89e3\u51b3\uff0c\u6240\u4ee5\u9700\u8981\u914d\u5907\u73af\u5883\u89c4\u5219\uff0c\u5176\u4ed6\u7684\u7c7b\u4f3c\uff1b<\/p>\n

\u4e0b\u9762\u662f\u652f\u6301wordpress\u7684\u4f2a\u9759\u6001\u89c4\u5219<\/p>\n

 <\/p>\n

IIS\u4f2a\u9759\u6001\u89c4\u5219<\/h3>\n

IIS \u73af\u5883\u662f Windows \u4e3b\u673a\u5e38\u7528\u7684\u670d\u52a1\u5668\u73af\u5883\uff0c\u65b0\u5efa\u4e00\u4e2a txt \u6587\u4ef6\uff0c\u5c06\u4e0b\u9762\u7684\u4ee3\u7801\u6dfb\u52a0\u5230\u6587\u4ef6\u4e2d\uff1a<\/p>\n

\n\n\n\n
\n
1\r\n2\r\n3\r\n4\r\n5\r\n6\r\n7\r\n8\r\n9\r\n10\r\n11\r\n12\r\n13\r\n14\r\n15\r\n16\r\n17\r\n18\r\n19\r\n20\r\n21\r\n22\r\n<\/pre>\n<\/td>\n
\n
[ISAPI_Rewrite]\r\n# Defend your computer from some worm attacks\r\n#RewriteRule .*(?:global.asa|default\\.ida|root\\.exe|\\.\\.).* . [F,I,O]\r\n# 3600 = 1 hour\r\n\r\nCacheClockRate 3600\r\nRepeatLimit 32\r\n\u00a0\r\n# Protect httpd.ini and httpd.parse.errors files\r\n# from accessing through HTTP\r\n# Rules to ensure that normal content gets through\r\n\r\nRewriteRule \/tag\/(.*) \/index\\.php\\?tag=$1\r\nRewriteRule \/software-files\/(.*) \/software-files\/$1 [L]\r\nRewriteRule \/images\/(.*) \/images\/$1 [L]\r\nRewriteRule \/sitemap.xml \/sitemap.xml [L]\r\nRewriteRule \/favicon.ico \/favicon.ico [L]\r\n# For file-based wordpress content (i.e. theme), admin, etc.\r\nRewriteRule \/wp-(.*) \/wp-$1 [L]\r\n# For normal wordpress content, via index.php\r\nRewriteRule ^\/$ \/index.php [L]\r\nRewriteRule \/(.*) \/index.php\/$1 [L]<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n

\u4fdd\u5b58\uff0c\u5220\u9664\u8bb0\u4e8b\u672c\u7684\u540d\u5b57\uff0c\u5305\u62ec\u540e\u7f00\u540d.txt\u4e00\u8d77\u5220\u6389\uff0c\u4fee\u6539\u4e3a\uff08.htaccess\uff09\u4e0a\u4f20\u6839\u76ee\u5f55\u5c31\u53ef\u4ee5\u4e86\u3002<\/p>\n

Apache\u4f2a\u9759\u6001\u89c4\u5219<\/h3>\n

Apache\u662f Linux \u4e3b\u673a\u4e0b\u5e38\u89c1\u7684\u73af\u5883\uff0c\u73b0\u5728\u4e00\u822c\u7684 Linux \u865a\u62df\u4e3b\u673a\u90fd\u91c7\u7528\u8fd9\u79cd\u73af\u5883\u3002\u65b0\u5efa\u4e00\u4e2a htaccess.txt \u6587\u4ef6\uff0c\u6dfb\u52a0\u4e0b\u9762\u7684\u4ee3\u7801\uff1a<\/p>\n

\n\n\n\n
\n
1\r\n2\r\n3\r\n4\r\n5\r\n6\r\n7\r\n8\r\n<\/pre>\n<\/td>\n
\n
<IfModule mod_rewrite.c>\r\nRewriteEngine On\r\nRewriteBase \/\r\nRewriteRule ^index\\.php$ - [L]\r\nRewriteCond %{REQUEST_FILENAME} !-f\r\nRewriteCond %{REQUEST_FILENAME} !-d\r\nRewriteRule . \/index.php [L]\r\n<\/IfModule><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n

\u7136\u540e\u4e0a\u4f20\u5230 WordPress \u7ad9\u70b9\u7684\u6839\u76ee\u5f55\uff0c\u91cd\u547d\u540d\u4e3a .htaccess \u5373\u53ef<\/p>\n

Nginx\u4f2a\u9759\u6001\u89c4\u5219<\/h3>\n

Nginx\u73af\u5883\u4e00\u822c\u662fLinux \u4e3b\u673a VPS\u6216\u670d\u52a1\u5668\u7528\u6237\u7528\u7684\u6bd4\u8f83\u591a\uff0c\u8fd9\u4e9b\u7528\u6237\u4e00\u822c\u90fd\u4f1a\u81ea\u5df1\u914d\u7f6eNginx\uff0c\u6216\u8005\u6709\u4e13\u95e8\u7684\u4eba\u5e2e\u4f60\u914d\u7f6e\uff0c\u6253\u5f00 nginx.conf \u6216\u8005\u67d0\u4e2a\u7ad9\u70b9\u7684\u914d\u7f6e\u73af\u5883\uff0c\u6bd4\u5982 wpdaxue.com.conf\uff08\u4e0d\u540c\u4eba\u914d\u7f6e\u7684\u4e0d\u4e00\u6837\uff09\uff0c\u5728\u00a0 server\u00a0\u00a0 { } \u5927\u62ec\u53f7\u91cc\u9762\u6dfb\u52a0\u4e0b\u9762\u7684\u4ee3\u7801\uff1a<\/p>\n

\n\n\n\n
\n
1\r\n2\r\n3\r\n4\r\n5\r\n6\r\n7\r\n8\r\n9\r\n10\r\n11\r\n<\/pre>\n<\/td>\n
\n
location \/ {\r\nif (-f $request_filename\/index.html){\r\n                rewrite (.*) $1\/index.html break;\r\n        }\r\nif (-f $request_filename\/index.php){\r\n                rewrite (.*) $1\/index.php;\r\n        }\r\nif (!-f $request_filename){\r\n                rewrite (.*) \/index.php;\r\n        }\r\n}<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n

\u4fdd\u5b58\uff0c\u91cd\u542f Nginx \u5373\u53ef\u3002<\/p>\n