{"id":29189,"date":"2024-11-25T16:46:58","date_gmt":"2024-11-25T08:46:58","guid":{"rendered":"https:\/\/fwq.ai\/blog\/29189\/"},"modified":"2024-11-25T16:46:58","modified_gmt":"2024-11-25T08:46:58","slug":"windows-iis-7-5-wordpress%e4%bc%aa%e9%9d%99%e6%80%81%e4%b8%ad%e6%96%87%e9%93%be%e6%8e%a5404%e9%94%99%e8%af%af%e8%a7%a3%e5%86%b3%e5%8a%9e%e6%b3%95","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/29189\/","title":{"rendered":"Windows IIS 7.5 WordPress\u4f2a\u9759\u6001\u4e2d\u6587\u94fe\u63a5404\u9519\u8bef\u89e3\u51b3\u529e\u6cd5"},"content":{"rendered":"<p style=\"text-align: center\"><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/000\/020\/5d9ff61420c5c820.jpg\" class=\"aligncenter\" title=\"Windows IIS 7.5 WordPress\u4f2a\u9759\u6001\u4e2d\u6587\u94fe\u63a5404\u9519\u8bef\u89e3\u51b3\u529e\u6cd5\u63d2\u56fe\" alt=\"Windows IIS 7.5 WordPress\u4f2a\u9759\u6001\u4e2d\u6587\u94fe\u63a5404\u9519\u8bef\u89e3\u51b3\u529e\u6cd5\u63d2\u56fe\" \/><\/p>\n<p>\u5bf9\u4e8e\u5efa\u7ad9\uff0c\u867d\u7136\u6211\u4eec\u4e00\u76f4\u63a8\u8350\u7528\u6237\u4f7f\u7528linux\u7cfb\u7edf\uff0c\u4f46\u662f\u65e0\u53ef\u907f\u514d\u7684\u4f9d\u7136\u4f1a\u6709\u5f88\u591a\u7528\u6237\u7531\u4e8e\u79cd\u79cd\u539f\u56e0\u9009\u62e9\u4e86windows\u7cfb\u7edf\uff0c\u5e76\u4e14\u4e5f\u4f1a\u7ecf\u5e38\u6709\u7528\u6237\u9047\u5230\u4e2d\u6587\u94fe\u63a5404\u9519\u8bef\u7684\u95ee\u9898\uff0c\u73b0\u5728\u680f\u76ee\u9488\u5bf9windows iis 7.5\u4e0b\u7684\u4e2d\u6587\u94fe\u63a5\uff08\u6bd4\u5982\u6807\u7b7e\u9875\uff09404\u9519\u8bef\u63d0\u4f9b\u4e00\u79cd\u89e3\u51b3\u65b9\u6848\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/image\/807\/286\/950\/1570764279163149.png\" class=\"aligncenter\" title=\"Windows IIS 7.5 WordPress\u4f2a\u9759\u6001\u4e2d\u6587\u94fe\u63a5404\u9519\u8bef\u89e3\u51b3\u529e\u6cd5\u63d2\u56fe1\" alt=\"Windows IIS 7.5 WordPress\u4f2a\u9759\u6001\u4e2d\u6587\u94fe\u63a5404\u9519\u8bef\u89e3\u51b3\u529e\u6cd5\u63d2\u56fe1\" \/><\/p>\n<p>\u9996\u5148\uff0c\u6211\u4eec\u5728WordPress\u5b89\u88c5\u76ee\u5f55\u4e0b\uff0c\u65b0\u5efa\u4e00\u4e2a\u201cindex2.php\u201d\u6587\u4ef6\uff0c\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n<pre>&lt;?php \/\/ IIS Mod-Rewrite\nif (isset($_SERVER[&#039;HTTP_X_ORIGINAL_URL&#039;])) {\n    $_SERVER[&#039;REQUEST_URI&#039;] = $_SERVER[&#039;HTTP_X_ORIGINAL_URL&#039;];\n}\n\/\/ IIS Isapi_Rewrite\nelse if (isset($_SERVER[&#039;HTTP_X_REWRITE_URL&#039;])) {\n    $_SERVER[&#039;REQUEST_URI&#039;] = $_SERVER[&#039;HTTP_X_REWRITE_URL&#039;];\n} else {\n    \/\/ Use ORIG_PATH_INFO if there is no PATH_INFO\n    if ( !isset($_SERVER[&#039;PATH_INFO&#039;]) &amp;&amp; isset($_SERVER[&#039;ORIG_PATH_INFO&#039;]) )\n        $_SERVER[&#039;PATH_INFO&#039;] = $_SERVER[&#039;ORIG_PATH_INFO&#039;];\n\/\/ Some IIS + PHP configurations puts the script-name in the path-info (No need to append it twice)\n    if ( isset($_SERVER[&#039;PATH_INFO&#039;]) ) {\n        if ( $_SERVER[&#039;PATH_INFO&#039;] == $_SERVER[&#039;SCRIPT_NAME&#039;] )\n            $_SERVER[&#039;REQUEST_URI&#039;] = $_SERVER[&#039;PATH_INFO&#039;];\n        else\n            $_SERVER[&#039;REQUEST_URI&#039;] = $_SERVER[&#039;SCRIPT_NAME&#039;] . $_SERVER[&#039;PATH_INFO&#039;];\n    }\n    \/\/ Append the query string if it exists and isn&#039;t null\n    if (isset($_SERVER[&#039;QUERY_STRING&#039;]) &amp;&amp; !empty($_SERVER[&#039;QUERY_STRING&#039;])) {\n        $_SERVER[&#039;REQUEST_URI&#039;] .= &#039;?&#039; . $_SERVER[&#039;QUERY_STRING&#039;];\n    }\n}\nrequire(\"index.php\");\n?&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u7136\u540e\u5728web.config\u4e2d\u65b0\u589e\u4e00\u6761\u89c4\u5219\uff0c\u5e76\u5c06\u6b64\u89c4\u5219\u7f6e\u4e8e\u89c4\u5219\u96c6\u5408\u7684\u9876\u90e8\uff1a<\/p>\n<pre>&lt;rule&gt;\n&nbsp;&lt;match&gt;&lt;\/match&gt;\n&nbsp;&lt;action&gt;&lt;\/action&gt;&lt;\/rule&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u6548\u679c\u5982\u4e0b\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/image\/661\/692\/781\/1570764242245598.png\" class=\"aligncenter\" title=\"Windows IIS 7.5 WordPress\u4f2a\u9759\u6001\u4e2d\u6587\u94fe\u63a5404\u9519\u8bef\u89e3\u51b3\u529e\u6cd5\u63d2\u56fe2\" alt=\"Windows IIS 7.5 WordPress\u4f2a\u9759\u6001\u4e2d\u6587\u94fe\u63a5404\u9519\u8bef\u89e3\u51b3\u529e\u6cd5\u63d2\u56fe2\" \/><\/p>\n<p>\u5982\u679c WordPress \u4e0d\u662f\u88c5\u5728\u6839\u76ee\u5f55\uff0c\u5219\u9700\u8981\u66f4\u6539\u201c \u201d\u4e3a\u201c \u201d\u3002\u5982\u679c\u5728\u56fa\u5b9a\u94fe\u63a5\u8bbe\u7f6e\u91cc\u628a\u9ed8\u8ba4\u7684\u6807\u7b7e\u524d\u7f00\u548c\u5206\u7c7b\u76ee\u5f55\u524d\u7f00\uff08tag \u548c category\uff09\u6539\u4e86\uff0c\u5219\u66f4\u6539\u8fd9\u53e5\u91cc\u7684\u5bf9\u5e94\u5185\u5bb9\u5373\u53ef\u3002<\/p>\n<p>\u4ee5\u4e0a\u65b9\u6cd5\u53ea\u9488\u5bf9\u6807\u7b7e\u548c\u5206\u7c7b\u91cc\u9762\u7684\u4e2d\u6587\u94fe\u63a5\uff0c\u5982\u679c\u60a8\u9700\u8981\u5bf9\u7f51\u7ad9\u7684\u5168\u90e8\u4e2d\u6587\u94fe\u63a5\uff08\u6bd4\u5982\u6587\u7ae0\u3001\u9875\u9762\u7b49\uff09\u8fdb\u884c\u8f6c\u5316\u652f\u6301\uff0c\u90a3\u4e48\u53ef\u4ee5\u4e0d\u7528\u6dfb\u52a0\u6700\u540e\u4e00\u6b65\u7684web.config\u89c4\u5219\uff0c\u53ea\u9700\u8981\u76f4\u63a5\u7f16\u8f91web.config\uff0c\u5c06\u4e0a\u56fe\u91cc\u9762\u7684 \u6539\u6210 \u5373\u53ef\u3002<\/p>\n<p>\u7531\u4e8e\u6b64\u65b9\u6cd5\u662f\u65b0\u5efaindex2.php\u6587\u4ef6\uff0c\u5e76\u914d\u5408\u4f2a\u9759\u6001\u89c4\u5219\u5b9e\u73b0\uff0c\u6240\u4ee5\u4e0d\u53d7WordPress\u66f4\u65b0\u5347\u7ea7\u5f71\u54cd\uff0c\u63a8\u8350\u4f7f\u7528\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fWindows IIS 7.5 WordPress\u4f2a\u9759\u6001\u4e2d\u6587\u94fe\u63a5404\u9519\u8bef\u89e3\u51b3\u529e\u6cd5\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5bf9\u4e8e\u5efa\u7ad9\uff0c\u867d\u7136\u6211\u4eec\u4e00\u76f4\u63a8\u8350\u7528\u6237\u4f7f\u7528linux\u7cfb\u7edf\uff0c\u4f46\u662f\u65e0\u53ef\u907f\u514d\u7684\u4f9d\u7136\u4f1a\u6709\u5f88\u591a\u7528\u6237\u7531\u4e8e\u79cd\u79cd\u539f\u56e0\u9009\u62e9\u4e86windows\u7cfb\u7edf\uff0c\u5e76\u4e14\u4e5f\u4f1a\u7ecf\u5e38\u6709\u7528\u6237\u9047\u5230\u4e2d\u6587\u94fe\u63a5404\u9519\u8bef\u7684\u95ee\u9898\uff0c\u73b0\u5728\u680f\u76ee\u9488\u5bf9windows iis 7.5\u4e0b\u7684\u4e2d\u6587\u94fe\u63a5\uff08\u6bd4\u5982\u6807\u7b7e\u9875\uff09404\u9519\u8bef\u63d0\u4f9b\u4e00\u79cd\u89e3\u51b3\u65b9\u6848\u3002 \u9996\u5148\uff0c\u6211\u4eec\u5728WordPress\u5b89\u88c5\u76ee\u5f55\u4e0b\uff0c\u65b0\u5efa\u4e00\u4e2a\u201cindex2.php\u201d\u6587\u4ef6\uff0c\u5185\u5bb9\u5982\u4e0b\uff1a &lt;?php \/\/ IIS Mod-Rewrite if (isset($_SERVER[&#039;HTTP_X_ORIGINAL_URL&#039;])) { $_SERVER[&#039;REQUEST_URI&#039;] = $_SERVER[&#039;HTTP_X_ORIGINAL_URL&#039;]; } \/\/ IIS Isapi_Rewrite else if (isset($_SERVER[&#039;HTTP_X_REWRITE_URL&#039;])) { $_SERVER[&#039;REQUEST_URI&#039;] = $_SERVER[&#039;HTTP_X_REWRITE_URL&#039;]; } else { \/\/ Use ORIG_PATH_INFO if there is no PATH_INFO if ( !isset($_SERVER[&#039;PATH_INFO&#039;]) &amp;&amp; isset($_SERVER[&#039;ORIG_PATH_INFO&#039;]) ) $_SERVER[&#039;PATH_INFO&#039;] = $_SERVER[&#039;ORIG_PATH_INFO&#039;]; \/\/ Some IIS + PHP configurations puts the script-name in [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[],"class_list":["post-29189","post","type-post","status-publish","format-standard","hentry","category-cms"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/29189","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=29189"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/29189\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=29189"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=29189"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=29189"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}