{"id":348,"date":"2018-03-17T00:00:47","date_gmt":"2018-03-16T16:00:47","guid":{"rendered":"https:\/\/cloudbool.com\/archive\/?p=348"},"modified":"2018-03-17T00:00:47","modified_gmt":"2018-03-16T16:00:47","slug":"change-domain-and-wordpress-and-nginx-modify","status":"publish","type":"post","link":"https:\/\/cloudbool.com\/archive\/change-domain-and-wordpress-and-nginx-modify.html","title":{"rendered":"\u66f4\u6362\u57df\u540d\u53caWordPress\u548cNginx\u76f8\u5e94\u7684\u914d\u7f6e\u66f4\u6539\u8bb0\u5f55"},"content":{"rendered":"<p>\u4e4b\u524d\u7684\u57df\u540d\u4e0a\u7ebf\u4e86\u5feb2\u4e2a\u6708\u4e86\uff0c\u767e\u5ea6\u8fd8\u662f\u6bcf\u5929\u6015\u4f46\u5c31\u662f\u4e0d\u6536\u5f55\uff0c\u6ca1\u529e\u6cd5\uff0c\u5199\u4e86\u8fd9\u4e48\u591a\u5e74\u7684\u535a\u5ba2\uff0c\u4e00\u76f4\u4e0d\u5728\u4e4e\u6d41\u91cf\u7684\u6211\u73b0\u5728\u4e5f\u50cf\u767e\u5ea6\u4f4e\u5934\u4e86\uff0c\u4e2d\u6587\u7ad9\u6765\u8bf4\uff0c\u767e\u5ea6\u7684\u6d41\u91cf\u8fd8\u662f\u6ca1\u529e\u6cd5\u5ffd\u89c6\u7684\uff0c\u4e8e\u662f\u8d81\u7740\u817e\u8baf\u4e91\u9001\u76842000\u5143\u4ee3\u91d1\u5238\u5feb\u8981\u5230\u671f\u8fd9\u4e2a\u673a\u4f1a\uff0c\u6293\u8033\u6320\u816e\u7ede\u5c3d\u8111\u6c41\u53c8\u6ce8\u518c\u4e86\u4e00\u4e2a\u57df\u540d\uff0c\u4e5f\u5c31\u662f\u73b0\u5728\u8fd9\u4e2a\uff0c\u6015\u81ea\u5df1\u4f1a\u540e\u6094\u53c8\u60f3\u534a\u8def\u6362\u57df\u540d\uff0c\u4e8e\u662f\u4e00\u4e0b\u5b50\u5c31\u6ce8\u518c\u4e865\u5e74\uff0c\u52a0\u4e0a\u4e70\u7684\u4e09\u5e74\u7684\u9999\u6e2f\u670d\u52a1\u5668\uff0c\u5230\u65f6\u5019\u5c31\u7b97\u670d\u52a1\u5668\u5230\u671f\uff0c\u57df\u540d\u90fd\u6ca1\u5230\u671f\uff0c\u4e5f\u4e0d\u77e5\u9053\u80fd\u4e0d\u80fd\u575a\u6301\u5199\u4e0b\u53bb\u3002<br \/>\n<!--more--><br \/>\n\u4e4b\u524d\u7684\u57df\u540d\u6ce8\u518c\u7684\u65f6\u5019\u6ca1\u60f3\u5230\u4e4b\u524d\u88ab\u4eba\u62ff\u53bb\u79cd\u83e0\u83dc\u4e86\uff0c\u641e\u5f97\u767e\u5ea6\u4e0d\u6536\u5f55\uff0c360\u4e0d\u6536\u5f55\uff0c\u5fae\u4fe1\u4e2d\u8bbf\u95ee\u4e5f\u88ab\u5c4f\u853d\u4e86\uff0c\u7b49\u4e86\u4e00\u4e2a\u591a\u6708\uff0c\u5b9e\u5728\u662f\u6ca1\u8010\u5fc3\u4e86\uff0c\u4e0d\u76f8\u7b49\u4e0b\u53bb\u4e86\uff0c\u4e0e\u5176\u7b49\u767e\u5ea6\u53ca\u5fae\u4fe1\u653e\u51fa\u6765\uff0c\u8fd8\u4e0d\u5982\u6ce8\u518c\u4e00\u4e2a\u65b0\u7684\u57df\u540d\u91cd\u65b0\u6765\u8fc7\uff0c\u8c01\u77e5\u9053\u5ea6\u5a18\u4ec0\u4e48\u65f6\u5019\u624d\u5fc3\u60c5\u597d\u628a\u5c31\u57df\u540d\u653e\u51fa\u6765\u3002<br \/>\n\u9664\u4e86\u66f4\u6362\u57df\u540d\uff0c\u542f\u7528\u8fd9\u4e2a\u57df\u540d\u7684\u65f6\u5019\uff0c\u6211\u987a\u4fbf\u628a\u8fd9\u4e2a\u7ad9\u70b9\u7684URL\u7ed3\u6784\u66f4\u6362\u4e86\u4e00\u4e0b\uff0c\u4ece\u4e4b\u524d\u7684\u57df\u540d\/\u5206\u7c7b\u540d\/\u6587\u7ae0\u540d\u6362\u6210\u4e86\u57df\u540d\/post\/\u6587\u7ae0\u540d\uff0c\u8fd9\u5c31\u5bfc\u81f4\u65b0\u8001\u57df\u540d\u4e0d\u80fd\u76f4\u63a5301\u8df3\u8f6c\uff0c\u5982\u679c\u4e0d\u8c03\u6574Nginx\u7684\u914d\u7f6e\uff0c\u90a3\u4ece\u4e4b\u524dURL\u8fc7\u6765\u7684\u8bf7\u6c42\u4f1a\u5168\u90e8404\uff0c\u4e8e\u662f\u5728\u66f4\u6362\u57df\u540d\u7684\u65f6\u5019\u53c8\u987a\u4fbf\u5b66\u4e86\u4e0bNginx\u7684\u6b63\u5219\u5339\u914d\uff0c\u539f\u4ee5\u4e3a\u4f1a\u6709\u70b9\u9ebb\u70e6\u7684\uff0c\u82b1\u4e86\u4e00\u4e2a\u5c0f\u65f6\u5de6\u53f3\u5305\u5b66\u4e60\u5305\u6d4b\u8bd5\u5c31\u641e\u5b9a\u4e86\uff0c\u8fd9\u91cc\u8d34\u4e00\u4e0b\u76f8\u5e94\u7684URL\u6b63\u5219\u5339\u914d\u5e76\u8df3\u8f6c\u90e8\u5206\u914d\u7f6e\uff1a<\/p>\n<pre><code>location \/{\n                if ( $uri ~* \/(.*)\/(.*)\\.html ){\n                        set $suffix $2;\n                        rewrite '^\/(.*)\/(.*)\\.html$' https:\/\/cloudbool.com\/archive\/post\/$2.html permanent;\n                }\n                rewrite ^\/(.*)$ https:\/\/cloudbool.com\/archive\/$1 permanent;\n        }\n<\/code><\/pre>\n<p>\u5b66\u4e60\u8fc7\u7a0b\u5b66\u4e60\u4e86\u4e00\u4e0bNginx\u7684\u6b63\u5219\u914d\u7f6e\uff0c\u4e0a\u8ff0\u914d\u7f6e\u5c31\u662f\u901a\u8fc7\u5339\u914dNginx\u81ea\u5e26\u7684\u5168\u5c40\u53d8\u91cf$uri\uff0c\u7136\u540e\u7528\u6b63\u5219\u5339\u914d\u51fa\u6587\u7ae0URL\u90e8\u5206\uff0c\u518d\u901a\u8fc7rewrite\u8df3\u8f6c\u5230\u52a0\u4e0a\u6587\u7ae0URL\u65b0\u57df\u540d\u76f8\u5e94\u7684URL\uff0c\u8fd9\u6837\u4ece\u539f\u6709\u7684URL\u8df3\u8f6c\u8fc7\u6765\u4e5f\u80fd\u8bbf\u95ee\u5230\u6b63\u786e\u7684URL\u4e0d\u4f1a\u5bfc\u81f4\u5927\u7247\u7684404\u3002<br \/>\n\u56e0\u4e3a\u6211\u8fd8\u66f4\u6539\u4e86URL\u7ed3\u6784\uff0c\u6240\u4ee5\u5728\u65b0\u7ad9\u6570\u636e\u5bfc\u5165\u7684\u65f6\u5019\uff0c\u4e4b\u524d\u5728\u6587\u7ae0\u5f15\u7528\u91cc\u9762\u5199\u6b7b\u7684URL\u4e5f\u8981\u54cd\u5e94\u66ff\u6362\uff0c\u8fd8\u597d\u6211\u4e4b\u524d\u5199\u6b7b\u7684URL\u4e0d\u591a\uff0c\u901a\u8fc7Vim\u7b80\u5355\u66ff\u6362\u5c31\u80fd\u641e\u5b9a\uff0c\u5168\u90e8\u66ff\u6362URL\u7ed3\u6784\u4e4b\u540e\u518d\u5bfc\u5165\u65b0\u7ad9\u6570\u636e\u5c31\u7b97\u8f6c\u6362\u6210\u529f\u4e86\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e4b\u524d\u7684\u57df\u540d\u4e0a\u7ebf\u4e86\u5feb2\u4e2a\u6708\u4e86\uff0c\u767e\u5ea6\u8fd8\u662f\u6bcf\u5929\u6015\u4f46\u5c31\u662f\u4e0d\u6536\u5f55\uff0c\u6ca1\u529e\u6cd5\uff0c\u5199\u4e86\u8fd9\u4e48\u591a\u5e74\u7684\u535a\u5ba2\uff0c\u4e00\u76f4\u4e0d\u5728\u4e4e\u6d41\u91cf\u7684\u6211\u73b0\u5728\u4e5f\u50cf &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/cloudbool.com\/archive\/change-domain-and-wordpress-and-nginx-modify.html\"> <span class=\"screen-reader-text\">\u66f4\u6362\u57df\u540d\u53caWordPress\u548cNginx\u76f8\u5e94\u7684\u914d\u7f6e\u66f4\u6539\u8bb0\u5f55<\/span> \u67e5\u770b\u5168\u6587 &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"footnotes":""},"categories":[183],"tags":[76,113],"class_list":["post-348","post","type-post","status-publish","format-standard","hentry","category-more","tag-nginx","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/posts\/348","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/comments?post=348"}],"version-history":[{"count":0,"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/posts\/348\/revisions"}],"wp:attachment":[{"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/media?parent=348"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/categories?post=348"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/tags?post=348"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}