{"id":4891,"date":"2022-05-31T11:17:25","date_gmt":"2022-05-31T03:17:25","guid":{"rendered":"https:\/\/www.yimenapp.com\/kb-yimen\/?p=4891"},"modified":"2022-05-31T11:17:31","modified_gmt":"2022-05-31T03:17:31","slug":"apache%e8%87%aa%e5%8a%a8%e8%b7%b3%e8%bd%ac%e5%88%b0-https-apache%e8%ae%be%e7%bd%aehttp%e8%b7%b3%e8%bd%achttps","status":"publish","type":"post","link":"https:\/\/www.yimenapp.com\/kb-yimen\/4891\/","title":{"rendered":"Apache\u81ea\u52a8\u8df3\u8f6c\u5230 HTTPS Apache\u8bbe\u7f6ehttp\u8df3\u8f6chttps"},"content":{"rendered":"\n<p><span class=\"wpcom_tag_link\"><a href=\"https:\/\/www.yimenapp.com\/kb-yimen\/tag\/apache\/\" title=\"Apache\" target=\"_blank\">Apache<\/a><\/span>\u81ea\u52a8\u8df3\u8f6c\u5230 HTTPS Apache\u8bbe\u7f6e<span class=\"wpcom_tag_link\"><a href=\"https:\/\/www.yimenapp.com\/kb-yimen\/tag\/http%e8%b7%b3%e8%bd%achttps\/\" title=\"http\u8df3\u8f6chttps\" target=\"_blank\">http\u8df3\u8f6chttps<\/a><\/span><\/p>\n\n\n\n<p>\u7f51\u7ad9\u6839\u76ee\u5f55\u65b0\u5efa\u00a0<strong>.<span class=\"wpcom_tag_link\"><a href=\"https:\/\/www.yimenapp.com\/kb-yimen\/tag\/htaccess\/\" title=\"htaccess\" target=\"_blank\">htaccess<\/a><\/span><\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>RewriteEngine On\r\nRewriteCond %{SERVER_PORT} 80\r\nRewriteRule ^(.*)$ https:\/\/%{HTTP_HOST}\/$1 &#091;R,L]<\/code><\/pre>\n\n\n\n<p>\u7ad9\u70b9\u7ed1\u5b9a\u591a\u4e2a\u57df\u540d\uff0c\u53ea\u5141\u8bb8<a rel=\"noreferrer noopener\" href=\"http:\/\/www.example.com\/\" target=\"_blank\">www.example.com<\/a>\u00a0\u8df3\u8f6c<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>RewriteEngine On\r\nRewriteCond %{SERVER_PORT} 80\r\nRewriteCond %{HTTP_HOST} ^example.com &#091;NC,OR]\r\nRewriteCond %{HTTP_HOST} ^www.example.com &#091;NC]\r\nRewriteRule ^(.*)$ https:\/\/%{HTTP_HOST}\/$1 &#091;R,L]<\/code><\/pre>\n\n\n\n<p>******\u628a\u7f51\u5740\u66f4\u6539\u4e3a\u81ea\u5df1\u7684******<\/p>\n\n\n\n<p><strong>\u9ad8\u7ea7\u7528\u6cd5 (\u53ef\u9009\uff09<\/strong><\/p>\n\n\n\n<p>RewriteEngine on<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u5f3a\u5236HTTPS\r\nRewriteCond %{HTTPS} !=on &#091;OR]\r\nRewriteCond %{SERVER_PORT} 80\r\n# \u67d0\u4e9b\u9875\u9762\u5f3a\u5236\r\nRewriteCond %{REQUEST_URI} ^something_secure &#091;OR]\r\nRewriteCond %{REQUEST_URI} ^something_else_secure\r\nRewriteRule .* https:\/\/%{SERVER_NAME}%{REQUEST_URI} &#091;R=301,L]\r\n# \u5f3a\u5236HTTP\r\nRewriteCond %{HTTPS} =on &#091;OR]\r\nRewriteCond %{SERVER_PORT} 443\r\n# \u67d0\u4e9b\u9875\u9762\u5f3a\u5236\r\nRewriteCond %{REQUEST_URI} ^something_public &#091;OR]\r\nRewriteCond %{REQUEST_URI} ^something_else_public\r\nRewriteRule .* http:\/\/%{SERVER_NAME}%{REQUEST_URI} &#091;R=301,L]<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u7f51\u7ad9\u6839\u76ee\u5f55\u65b0\u5efa\u00a0.htaccess\uff0c\u81ea\u52a8\u8df3\u8f6c\u5230 HTTPS Apache\u8bbe\u7f6ehttp\u8df3\u8f6chttps<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1481],"tags":[1493,1497,1486,212,1484],"special":[],"attr":[],"class_list":{"0":"post-4891","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-ssl","7":"tag-apache","8":"tag-htaccess","9":"tag-httphttps","10":"tag-ssl","12":"entry"},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/posts\/4891","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/comments?post=4891"}],"version-history":[{"count":1,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/posts\/4891\/revisions"}],"predecessor-version":[{"id":4892,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/posts\/4891\/revisions\/4892"}],"wp:attachment":[{"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/media?parent=4891"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/categories?post=4891"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/tags?post=4891"},{"taxonomy":"special","embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/special?post=4891"},{"taxonomy":"attr","embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/attr?post=4891"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}