{"id":398,"date":"2016-04-12T15:13:20","date_gmt":"2016-04-12T07:13:20","guid":{"rendered":"http:\/\/www.behindgfw.com\/archives\/?p=398"},"modified":"2019-06-23T20:48:51","modified_gmt":"2019-06-23T12:48:51","slug":"login-wordpress-admin-with-ssl","status":"publish","type":"post","link":"https:\/\/www.behindgfw.com\/archives\/2016\/04\/login-wordpress-admin-with-ssl.html","title":{"rendered":"WordPress\u540e\u53f0\u7528https\u8bbf\u95ee\uff0c\u524d\u53f0\u4f7f\u7528http\u65f6\u7684\u8bbe\u7f6e"},"content":{"rendered":"<p style=\"text-align: justify; padding-left: 30px;\">\u6807\u9898\u597d\u957f\uff0c\u4e00\u53e3\u6c14\u5598\u4e0d\u8fc7\u6765\u3002<\/p>\n<p style=\"text-align: justify;\">WordPress\u540e\u53f0\u8bbe\u7f6ehttps\u767b\u5f55\uff0c\u8c8c\u4f3c\u5b89\u5168\u5f88\u591a\uff0c\u901a\u8fc7\u5728wp-config.php\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\u5b9e\u73b0\u3002<\/p>\n<blockquote><p>define(&#8216;FORCE_SSL_ADMIN&#8217;,true);<\/p><\/blockquote>\n<p>\u5728WordPress\u5b98\u65b9\u6587\u6863\u4e5f\u63d0\u5230\u5728http\u548chttps\u4e24\u4e2a\u865a\u62df\u4e3b\u673a\u91cc\u5206\u522b\u8bbe\u7f6e\u4e00\u4e2a\u5730\u5740\u76f8\u540c\u7684\u94fe\u63a5\uff1a<\/p>\n<blockquote><p>Sometimes, you want your whole wp-admin to run over a secure connection using the https protocol. Conceptually, the procedure works like this:<\/p>\n<p>Set up two virtual hosts with the same url (the blog url), one secure, the other not.<br \/>\nOn the secure virtual host, set up a rewrite rule that shuttles all non-wp-admin traffic to the insecure site.<br \/>\nOn the insecure virtual host, set up a rewrite rule that shuttles all traffic to wp-admin to the secure host.<br \/>\nPut in a filter (via a plugin) that filters the links in wp-admin so that once activated, administrative links are rewritten to use https and that edits cookies to work only over encrypted connections.<\/p><\/blockquote>\n<p><strong>\u95ee\u9898<\/strong>\uff1a\u4e0d\u60f3\u5f00\u542f\u5168\u7ad9https\uff0c\u540c\u65f6http\u548chttps\u865a\u62df\u4e3b\u673a\u8bbe\u7f6edocumentroot\u4e3a\u4e0d\u540c\u76ee\u5f55\u65f6\uff0c\u7528rewrite\u8f6c\u6765\u8f6c\u53bb\u5b9e\u5728\u9ebb\u70e6\u3002<\/p>\n<p>\u5176\u5b9e\u901a\u8fc7Apache\u522b\u540d\u53ef\u4ee5\u7b80\u5355\u641e\u5b9a\uff0c\u5728https\u865a\u62df\u4e3b\u673a\u8bbe\u7f6e\u91cc\u5199\u5165\u5982\u4e0b\u4ee3\u7801\uff1a<\/p>\n<blockquote><p><strong>Alias \/blogurl \/pathto\/http\/blogurl<\/strong><\/p><\/blockquote>\n<p>\u8fd9\u6837\uff0c\u4e24\u4e2a\u865a\u62df\u4e3b\u673a\u4f7f\u7528\u7684\u662f\u540c\u4e00\u4e2a\u76ee\u5f55\uff0c\u8fd8\u53ef\u4ee5\u907f\u514d\u63d2\u4ef6\u3001\u4e3b\u9898\u3001\u4e0a\u4f20\u6587\u6863\u5404\u79cd\u4e0d\u540c\u6b65\u95ee\u9898\u3002<br \/>\n<b> \u524d\u9762\u7684\/blogurl\u6307\u7684\u662fWordpress url\u5730\u5740\uff0c\u6bd4\u5982\u8fd9\u91cc\u5c31\u662f\/archives\u3002\u540e\u9762\u7684\/blogurl\u4ee3\u8868\u7269\u7406http WordPress\u76ee\u5f55\uff0c<\/b>\u3002<\/p>\n<p>\u4e0d\u77e5\u9053\u8fd8\u6709\u4ec0\u4e48\u6ca1\u53d1\u73b0\u7684\u95ee\u9898\uff1f<\/p>\n<p>\u53c2\u8003\uff1a<a href=\"https:\/\/codex.wordpress.org\/Administration_Over_SSL\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/codex.wordpress.org\/Administration_Over_SSL<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6807\u9898\u597d\u957f\uff0c\u4e00\u53e3\u6c14\u5598\u4e0d\u8fc7\u6765\u3002 WordPress\u540e\u53f0\u8bbe\u7f6ehttps\u767b\u5f55\uff0c\u8c8c\u4f3c\u5b89\u5168\u5f88\u591a\uff0c\u901a\u8fc7\u5728wp-config. [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,7],"tags":[67,34,14],"class_list":["post-398","post","type-post","status-publish","format-standard","hentry","category-blog","category-webdev","tag-blog","tag-host","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/www.behindgfw.com\/archives\/wp-json\/wp\/v2\/posts\/398","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.behindgfw.com\/archives\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.behindgfw.com\/archives\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.behindgfw.com\/archives\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.behindgfw.com\/archives\/wp-json\/wp\/v2\/comments?post=398"}],"version-history":[{"count":17,"href":"https:\/\/www.behindgfw.com\/archives\/wp-json\/wp\/v2\/posts\/398\/revisions"}],"predecessor-version":[{"id":1049,"href":"https:\/\/www.behindgfw.com\/archives\/wp-json\/wp\/v2\/posts\/398\/revisions\/1049"}],"wp:attachment":[{"href":"https:\/\/www.behindgfw.com\/archives\/wp-json\/wp\/v2\/media?parent=398"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.behindgfw.com\/archives\/wp-json\/wp\/v2\/categories?post=398"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.behindgfw.com\/archives\/wp-json\/wp\/v2\/tags?post=398"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}