{"id":29226,"date":"2024-11-25T17:50:57","date_gmt":"2024-11-25T09:50:57","guid":{"rendered":"https:\/\/fwq.ai\/blog\/29226\/"},"modified":"2024-11-25T17:50:57","modified_gmt":"2024-11-25T09:50:57","slug":"%e8%ae%a9phpstudy2018-nginx-%e6%94%af%e6%8c%81wordpress%e8%87%aa%e5%ae%9a%e4%b9%89%e9%93%be%e6%8e%a5","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/29226\/","title":{"rendered":"\u8ba9phpStudy2018 Nginx \u652f\u6301WordPress\u81ea\u5b9a\u4e49\u94fe\u63a5"},"content":{"rendered":"<p>\u4e0b\u9762\u7531\/&#8221; target=&#8221;_blank&#8221;&gt;<strong>wordpress\u6559\u7a0b<\/strong>\u680f\u76ee\u7ed9\u5927\u5bb6\u4ecb\u7ecd\u8ba9phpstudy2018 nginx \u652f\u6301wordpress\u81ea\u5b9a\u4e49\u94fe\u63a5\u7684\u65b9\u6cd5\uff0c\u5e0c\u671b\u5bf9\u9700\u8981\u7684\u670b\u53cb\u6709\u6240\u5e2e\u52a9\uff01<\/p>\n<p>\u53ea\u9002\u5408Windows\u672c\u5730\u73af\u5883\uff08\u670d\u52a1\u5668\u4e0a\u6ca1\u8bd5\u8fc7\uff09\uff0c\u9ed8\u8ba4phpStudy2018 Nginx\u5e76\u4e0d\u652f\u6301WordPress\u81ea\u5b9a\u4e49\u94fe\u63a5\uff0c\u53ef\u4ee5\u901a\u8fc7\u4fee\u6539\u914d\u7f6e\u6587\u4ef6\u652f\u6301\u8ba9\u5176\u652f\u6301\u3002<\/p>\n<p>\u7528\u6587\u672c\u7f16\u8f91\u5de5\u5177\u6253\u5f00PHPTutorial ginxconf\u76ee\u5f55\u7684nginx.conf\u6587\u4ef6\uff0c\u4fee\u6539\u524d\u505a\u4e2a\u5907\u4efd\uff0c\u4ee5\u514d\u4fee\u6539\u5931\u8bef\uff0c\u9020\u6210phpStudy\u65e0\u6cd5\u542f\u52a8\u3002<\/p>\n<p>\u641c\u7d22autoindex on\uff0c\u627e\u5230\u7c7b\u4f3c\uff1a<\/p>\n<pre>&nbsp;&nbsp;server&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;listen&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;80;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;server_name&nbsp;&nbsp;localhost;\n&nbsp;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#charset&nbsp;koi8-r;\n&nbsp;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#access_log&nbsp;&nbsp;logs\/host.access.log&nbsp;&nbsp;main;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;root&nbsp;&nbsp;&nbsp;&nbsp;\"I:\/phpStudy\/PHPTutorial\/WWW\";\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;location&nbsp;\/&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;index&nbsp;&nbsp;index.html&nbsp;index.htm&nbsp;index.php&nbsp;l.php;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;autoindex&nbsp;&nbsp;on;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5728\u5176\u4e0b\u9762\u6dfb\u52a0\u8bbe\u7f6e\u4ee3\u7801\uff0c\u6709\u4e24\u79cd\u60c5\u51b5\uff1a<\/p>\n<p><span>\u7acb\u5373\u5b66\u4e60<\/span>\u201c\u201d\uff1b<\/p>\n<p>\u4e00\u3001WordPress\u7a0b\u5e8f\u76f4\u63a5\u5b89\u88c5\u5728PHPTutorialWWW\u76ee\u5f55\u4e2d\uff1a<\/p>\n<pre>if&nbsp;(-f&nbsp;$request_filename\/index.html){\nrewrite&nbsp;(.*)&nbsp;$1\/index.html&nbsp;break;\n}\nif&nbsp;(-f&nbsp;$request_filename\/index.php){\nrewrite&nbsp;(.*)&nbsp;$1\/index.php;\n}\nif&nbsp;(!-f&nbsp;$request_filename){\nrewrite&nbsp;(.*)&nbsp;\/index.php;\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4e8c\u3001WordPress\u7a0b\u5e8f\u5b89\u88c5\u5728PHPTutorialWWW\u5b50\u76ee\u5f55\u4e2d\uff0c\u6bd4\u5982\uff1awordpress\uff1a<\/p>\n<pre>if&nbsp;(-f&nbsp;$request_filename\/wordpress\/index.html){\nrewrite&nbsp;(.*)&nbsp;$1\/wordpress\/index.html&nbsp;break;\n}\nif&nbsp;(-f&nbsp;$request_filename\/wordpress\/index.php){\nrewrite&nbsp;(.*)&nbsp;$1\/wordpress\/index.php;\n}\nif&nbsp;(!-f&nbsp;$request_filename){\nrewrite&nbsp;(.*)&nbsp;\/wordpress\/index.php;\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4fee\u6539\u5176\u4e2d\u7684wordpress\u4e3a\u4f60\u5b50\u76ee\u5f55\u540d\u79f0\u3002<\/p>\n<p>\u6700\u540e\u91cd\u542fphpStudy\uff0c\u8bd5\u8bd5\u8bbe\u7f6e\u81ea\u5b9a\u4e49\u94fe\u63a5\u662f\u5426\u53ef\u4ee5\u6253\u5f00\u4e86\u3002<\/p>\n<p>phpStudy \u6700\u65b0\u7248\u672c\u662f8.0\uff0c\u6b64\u65b9\u6cd5\u5e76\u672a\u5728\u6b64\u7248\u672c\u4e2d\u8bd5\u8fc7\u3002<\/p>\n<p>\u53ef\u4ee5\u5230\u5b98\u7f51\u4e0b\u8f7d\u9002\u5408\u7684\u7248\u672c\uff1ahttps:\/\/www.xp.cn\/download.html<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u8ba9phpStudy2018 Nginx \u652f\u6301WordPress\u81ea\u5b9a\u4e49\u94fe\u63a5\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>\u4e0b\u9762\u7531\/&#8221; target=&#8221;_blank&#8221;&gt;wordpress\u6559\u7a0b\u680f\u76ee\u7ed9\u5927\u5bb6\u4ecb\u7ecd\u8ba9phpstudy2018 nginx \u652f\u6301wordpress\u81ea\u5b9a\u4e49\u94fe\u63a5\u7684\u65b9\u6cd5\uff0c\u5e0c\u671b\u5bf9\u9700\u8981\u7684\u670b\u53cb\u6709\u6240\u5e2e\u52a9\uff01 \u53ea\u9002\u5408Windows\u672c\u5730\u73af\u5883\uff08\u670d\u52a1\u5668\u4e0a\u6ca1\u8bd5\u8fc7\uff09\uff0c\u9ed8\u8ba4phpStudy2018 Nginx\u5e76\u4e0d\u652f\u6301WordPress\u81ea\u5b9a\u4e49\u94fe\u63a5\uff0c\u53ef\u4ee5\u901a\u8fc7\u4fee\u6539\u914d\u7f6e\u6587\u4ef6\u652f\u6301\u8ba9\u5176\u652f\u6301\u3002 \u7528\u6587\u672c\u7f16\u8f91\u5de5\u5177\u6253\u5f00PHPTutorial ginxconf\u76ee\u5f55\u7684nginx.conf\u6587\u4ef6\uff0c\u4fee\u6539\u524d\u505a\u4e2a\u5907\u4efd\uff0c\u4ee5\u514d\u4fee\u6539\u5931\u8bef\uff0c\u9020\u6210phpStudy\u65e0\u6cd5\u542f\u52a8\u3002 \u641c\u7d22autoindex on\uff0c\u627e\u5230\u7c7b\u4f3c\uff1a &nbsp;&nbsp;server&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;listen&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;80; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;server_name&nbsp;&nbsp;localhost; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#charset&nbsp;koi8-r; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#access_log&nbsp;&nbsp;logs\/host.access.log&nbsp;&nbsp;main; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;root&nbsp;&nbsp;&nbsp;&nbsp;&#8220;I:\/phpStudy\/PHPTutorial\/WWW&#8221;; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;location&nbsp;\/&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;index&nbsp;&nbsp;index.html&nbsp;index.htm&nbsp;index.php&nbsp;l.php; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;autoindex&nbsp;&nbsp;on; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} \u767b\u5f55\u540e\u590d\u5236 \u5728\u5176\u4e0b\u9762\u6dfb\u52a0\u8bbe\u7f6e\u4ee3\u7801\uff0c\u6709\u4e24\u79cd\u60c5\u51b5\uff1a \u7acb\u5373\u5b66\u4e60\u201c\u201d\uff1b \u4e00\u3001WordPress\u7a0b\u5e8f\u76f4\u63a5\u5b89\u88c5\u5728PHPTutorialWWW\u76ee\u5f55\u4e2d\uff1a if&nbsp;(-f&nbsp;$request_filename\/index.html){ rewrite&nbsp;(.*)&nbsp;$1\/index.html&nbsp;break; } if&nbsp;(-f&nbsp;$request_filename\/index.php){ rewrite&nbsp;(.*)&nbsp;$1\/index.php; } if&nbsp;(!-f&nbsp;$request_filename){ rewrite&nbsp;(.*)&nbsp;\/index.php; } \u767b\u5f55\u540e\u590d\u5236 \u4e8c\u3001WordPress\u7a0b\u5e8f\u5b89\u88c5\u5728PHPTutorialWWW\u5b50\u76ee\u5f55\u4e2d\uff0c\u6bd4\u5982\uff1awordpress\uff1a if&nbsp;(-f&nbsp;$request_filename\/wordpress\/index.html){ rewrite&nbsp;(.*)&nbsp;$1\/wordpress\/index.html&nbsp;break; } if&nbsp;(-f&nbsp;$request_filename\/wordpress\/index.php){ rewrite&nbsp;(.*)&nbsp;$1\/wordpress\/index.php; } if&nbsp;(!-f&nbsp;$request_filename){ rewrite&nbsp;(.*)&nbsp;\/wordpress\/index.php; } \u767b\u5f55\u540e\u590d\u5236 \u4fee\u6539\u5176\u4e2d\u7684wordpress\u4e3a\u4f60\u5b50\u76ee\u5f55\u540d\u79f0\u3002 \u6700\u540e\u91cd\u542fphpStudy\uff0c\u8bd5\u8bd5\u8bbe\u7f6e\u81ea\u5b9a\u4e49\u94fe\u63a5\u662f\u5426\u53ef\u4ee5\u6253\u5f00\u4e86\u3002 phpStudy \u6700\u65b0\u7248\u672c\u662f8.0\uff0c\u6b64\u65b9\u6cd5\u5e76\u672a\u5728\u6b64\u7248\u672c\u4e2d\u8bd5\u8fc7\u3002 \u53ef\u4ee5\u5230\u5b98\u7f51\u4e0b\u8f7d\u9002\u5408\u7684\u7248\u672c\uff1ahttps:\/\/www.xp.cn\/download.html \u4ee5\u4e0a\u5c31\u662f\u8ba9phpStudy2018 Nginx \u652f\u6301WordPress\u81ea\u5b9a\u4e49\u94fe\u63a5\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/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-29226","post","type-post","status-publish","format-standard","hentry","category-cms"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/29226","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=29226"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/29226\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=29226"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=29226"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=29226"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}