{"id":1650,"date":"2017-05-08T17:22:37","date_gmt":"2017-05-08T09:22:37","guid":{"rendered":"https:\/\/www.ldhost.cn\/jc\/?p=1650"},"modified":"2026-01-16T15:15:28","modified_gmt":"2026-01-16T07:15:28","slug":"%e5%ae%89%e8%a3%85ssl%e8%af%81%e4%b9%a6%e5%90%8e%e8%ae%be%e7%bd%ae301%e8%b7%b3%e8%bd%ac%e5%b0%86http%e8%b7%b3%e8%bd%ac%e5%88%b0https%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.ldhost.cn\/jc\/weberror\/1650.html","title":{"rendered":"\u5b89\u88c5SSL\u8bc1\u4e66\u540e\u8bbe\u7f6e301\u8df3\u8f6c\u5c06http\u8df3\u8f6c\u5230https\u65b9\u6cd5"},"content":{"rendered":"<p><a href=\"https:\/\/www.ldhost.cn\/jc\/service\/3277.html\" target=\"_blank\" rel=\"noopener noreferrer\">\u5b89\u88c5SSL\u8bc1\u4e66<\/a>\u540e\u8bbe\u7f6e301\u8df3\u8f6c\u5c06http\u8df3\u8f6c\u5230https\u65b9\u6cd5\uff0c\u4e3b\u673a\u73af\u5883\u4e0d\u540c\uff0c\u65b9\u6cd5\u4e5f\u4e0d\u76f8\u540c\uff0c\u5982\u4e0b\u51e0\u79cd\uff1a<\/p>\n<p><span style=\"color: #ff0000;\">linuxt\u7cfb\u7edf apache\u73af\u5883<\/span><br \/>\n\u4e91\u670d\u52a1\u5668\uff1a\u5728\u5bf9\u5e94\u7ad9\u70b9\u6839\u76ee\u5f55\u4e0b\u65b0\u5efa\uff08\u901a\u8fc7ftp\u6216\u767b\u5f55wdcp\u7ba1\u7406\u9762\u677f\u4e2d\uff1a\u7ad9\u70b9\u5217\u8868-\u6587\u7ba1-\u8fdb\u5165public_html-\u521b\u5efa\u6587\u4ef6\uff09\u4e00\u4e2a\u6587\u4ef6\u547d\u540d\u4e3a.htaccess\u3002<br \/>\n<a href=\"https:\/\/www.ldhost.cn\" target=\"_blank\" rel=\"noopener noreferrer\">\u865a\u62df\u4e3b\u673a<\/a>\uff1a\u53ef\u4ee5\u901a\u8fc7ftp\u6216\u767b\u5f55\u540e\u8fdb\u5165\u5230\u4e3b\u673a\u7ba1\u7406\u9762\u677f-\u6587\u4ef6\u7ba1\u7406,\u8fdb\u5165public_html,\u65b0\u5efa\u4e00\u4e2a\u6587\u4ef6\u547d\u540d\u4e3a.htaccess\u6587\u4ef6,\u4fdd\u5b58\u5373\u53ef\u3002<br \/>\n\u7f16\u8f91.htaccess\u6587\u4ef6\u5199\u5165\u4ee5\u4e0b\u89c4\u5219\uff1a<\/p>\n<pre lang=\"\u201dphp\u201d\">RewriteBase \/\nRewriteCond %{SERVER_PORT} !^443$\nRewriteRule ^.*$ https:\/\/%{SERVER_NAME}%{REQUEST_URI} [L,R]\n\n<\/pre>\n<p>\u5982\u4f7f\u7528\u65e0\u6548\u53ef\u4ee5\u7528\u4ee5\u4e0b\u4ee3\u7801\u8bd5\u8bd5\uff1a<\/p>\n<pre lang=\"\u201dphp\u201d\">&lt;IfModule mod_rewrite.c&gt;\nRewriteEngine On\nRewriteCond %{HTTP:From-Https} !^on$ [NC]\nRewriteCond %{HTTP_HOST} ^(www.)?abc.com$ [NC]\nRewriteRule ^(.*)$ https:\/\/www.abc.com\/$1 [R=301,L]\n&lt;\/IfModule&gt;\n<span style=\"color: #ff0000;\"># www.abc.com\u5bf9\u5e94\u4fee\u6539\u4e3a\u60a8\u81ea\u5df2\u7684\u57df\u540d<\/span><\/pre>\n<p>Nginx\u73af\u5883<br \/>\n\u7f16\u8f91nginx\u7ad9\u70b9\u914d\u7f6e\u6587\u4ef6\uff08\u767b\u5f55wdcp\u7ba1\u7406\u9762\u677f\u4e2d\uff1a\u7ad9\u70b9\u5217\u8868-\u6587\u7ba1-\u865a\u62df\u4e3b\u673a\u7ad9\u70b9\u6587\u4ef6nginx-\u5bf9\u5e94\u7ad9\u70b9\u914d\u7f6e\u6587\u4ef6\uff09\uff0c\u6dfb\u52a0\u4ee5\u4e0b\u89c4\u5219<\/p>\n<pre lang=\"\u201dphp\u201d\"> \nserver\n{\nlisten 80;\nserver_name abc.com;\nrewrite ^(.*) https:\/\/www.abc.com$1 permanent; # abc.com\u5bf9\u5e94\u4fee\u6539\u4e3a\u60a8\u81ea\u5df2\u7684\u57df\u540d\n}\n<\/pre>\n<p>Windows\u7cfb\u7edf II7\u73af\u5883<br \/>\n\u4e91\u670d\u52a1\u5668\uff1a\u5728\u5bf9\u5e94\u7ad9\u70b9\u6839\u76ee\u5f55\u4e0b\u65b0\u5efa\uff08\u901a\u8fc7ftp\u6216\u767b\u5f55\u540e\u76f4\u63a5\u8fdb\u5165\u5230D:\\wwwroot\\\u7ad9\u70b9ftp\u547d\u540d\u76ee\u5f55\\wwwroot\u521b\u5efa\uff09\u4e00\u4e2a\u6587\u4ef6\u547d\u540d\u4e3aweb.config\u5e76\u7f16\u8f91\u6dfb\u52a0\u4ee5\u4e0b\u89c4\u5219\uff1a<\/p>\n<pre lang=\"\u201dphp\u201d\"> \n&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\n&lt;configuration&gt;\n&lt;system.webServer&gt;\n&lt;rewrite&gt;\n&lt;rules&gt;\n&lt;rule name=\"301\" stopProcessing=\"true\"&gt;\n&lt;match url=\"^(.*)$\" ignoreCase=\"false\" \/&gt;\n&lt;conditions logicalGrouping=\"MatchAll\"&gt;\n&lt;add input=\"{HTTPS}\" pattern=\"^on$\" negate=\"true\" \/&gt;\n&lt;\/conditions&gt;\n&lt;action type=\"Redirect\" url=\"https:\/\/www.abc.com\/{R:1}\" redirectType=\"Permanent\" \/&gt; # www.abc.com\u5bf9\u5e94\u4fee\u6539\u4e3a\u60a8\u81ea\u5df2\u7684\u57df\u540d\n&lt;\/rule&gt;\n&lt;\/rules&gt;\n&lt;\/rewrite&gt;\n&lt;\/system.webServer&gt;\n&lt;\/configuration&gt;\n<\/pre>\n<p>\u865a\u62df\u4e3b\u673a\uff1a\u53ef\u4ee5\u901a\u8fc7ftp\u6216\u767b\u5f55\u540e\u8fdb\u5165\u5230\u4e3b\u673a\u7ba1\u7406\u9762\u677f-\u6587\u4ef6\u7ba1\u7406,\u8fdb\u5165wwwroot\u6839\u76ee\u5f55,\u65b0\u5efa\u4e00\u4e2a\u6587\u4ef6\u547d\u540d\u4e3aweb.config\u5e76\u7f16\u8f91\u6dfb\u52a0\u4ee5\u4e0b\u89c4\u5219\uff1a<\/p>\n<pre lang=\"\u201dphp\u201d\"> \n&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\n&lt;configuration&gt;\n&lt;system.webServer&gt;\n&lt;rewrite&gt;\n&lt;rules&gt;\n&lt;rule name=\"301\" stopProcessing=\"true\"&gt;\n&lt;match url=\"^(.*)$\" ignoreCase=\"false\" \/&gt;\n&lt;conditions logicalGrouping=\"MatchAll\"&gt;\n&lt;add input=\"{HTTP_FROM_HTTPS}\" pattern=\"^on$\" negate=\"true\" \/&gt;\n&lt;\/conditions&gt;\n&lt;action type=\"Redirect\" url=\"https:\/\/www.abc.com\/{R:1}\" redirectType=\"Permanent\" \/&gt; # www.abc.com\u5bf9\u5e94\u4fee\u6539\u4e3a\u60a8\u81ea\u5df2\u7684\u57df\u540d\n&lt;\/rule&gt;\n&lt;\/rules&gt;\n&lt;\/rewrite&gt;\n&lt;\/system.webServer&gt;\n&lt;\/configuration&gt;\n\n\u5982\u4ee5\u4e0a\u65e0\u6548\u8bd5\u8bd5\u4ee5\u4e0b\u4ee3\u7801\uff1a\n\n&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\n&lt;configuration&gt;\n    &lt;system.webServer&gt;\n        &lt;rewrite&gt;\n            &lt;rules&gt;\n                &lt;rule name=\"Imported Rule 1\" stopProcessing=\"true\"&gt;\n                    &lt;match url=\"^(.*)$\" ignoreCase=\"false\" \/&gt;\n                    &lt;conditions logicalGrouping=\"MatchAll\"&gt;\n                        &lt;add input=\"{HTTP_FROM_HTTPS}\" pattern=\"^on$\" negate=\"true\" \/&gt;\n                    &lt;\/conditions&gt;\n                    &lt;action type=\"Redirect\" url=\"https:\/\/www.\u6362\u6210\u4f60\u7684\u57df\u540d.com\/{R:1}\" redirectType=\"Permanent\" \/&gt;\n                &lt;\/rule&gt;\n            &lt;\/rules&gt;\n        &lt;\/rewrite&gt;\n    &lt;\/system.webServer&gt;\n&lt;\/configuration&gt;<\/pre>\n<p>Windows\u7cfb\u7edf II6\u73af\u5883<br \/>\n\u914d\u7f6e\u4e00\u4e2aRewrite,\u7f16\u8f91\u8be5Rewrite\u7684\u89c4\u5219\u6587\u4ef6httpd.conf \u6dfb\u52a0\u4ee5\u4e0b\u89c4\u5219\u3002<\/p>\n<pre lang=\"\u201dphp\u201d\"> \n&lt;IfModule mod_rewrite.c&gt;\nRewriteEngine On\nRewriteCond %{HTTP:From-Https} !^on$ [NC]\nRewriteRule ^(.*)$ https:\/\/www.abc.com\/$1 [R=301,L] # www.abc.com\u5bf9\u5e94\u4fee\u6539\u4e3a\u60a8\u81ea\u5df2\u7684\u57df\u540d\nRewriteCond %{HTTP_HOST} !^www\\.\nRewriteRule ^(.*)$ https:\/\/www.abc.com$1 [R=301,L] # www.abc.com\u5bf9\u5e94\u4fee\u6539\u4e3a\u60a8\u81ea\u5df2\u7684\u57df\u540d\n&lt;\/IfModule&gt;<\/pre>\n<p>\u6ce8\uff1adiscuz\u4f7f\u7528301\u65b9\u5f0f\u5f3a\u5236\u5c06http\u8df3\u8f6c\u5230https\u540e\u4f1a\u5bfc\u81f4\u540e\u53f0uc\u901a\u4fe1\u5931\u8d25\u3002<\/p>\n<div><img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/images\/ad-845-3.png\" alt=\"\u56fe\u7247\u63cf\u8ff0\" \/><\/div>","protected":false},"excerpt":{"rendered":"<p>\u5b89\u88c5SSL\u8bc1\u4e66\u540e\u8bbe\u7f6e301\u8df3\u8f6c\u5c06http\u8df3\u8f6c\u5230https\u65b9\u6cd5\uff0c\u4e3b\u673a\u73af\u5883\u4e0d\u540c\uff0c\u65b9\u6cd5\u4e5f\u4e0d\u76f8\u540c\uff0c\u5982\u4e0b\u51e0\u79cd\uff1a linuxt\u7cfb\u7edf apache\u73af\u5883 \u4e91\u670d\u52a1\u5668\uff1a\u5728\u5bf9\u5e94\u7ad9\u70b9\u6839\u76ee\u5f55\u4e0b\u65b0\u5efa\uff08\u901a\u8fc7ftp\u6216\u767b\u5f55wdcp\u7ba1\u7406\u9762\u677f\u4e2d\uff1a\u7ad9\u70b9\u5217\u8868-\u6587\u7ba1-\u8fdb\u5165public_html-\u521b\u5efa\u6587\u4ef6\uff09\u4e00\u4e2a\u6587\u4ef6\u547d\u540d\u4e3a.htaccess\u3002 \u865a\u62df\u4e3b\u673a\uff1a\u53ef\u4ee5\u901a\u8fc7ftp\u6216\u767b\u5f55\u540e\u8fdb\u5165\u5230\u4e3b\u673a\u7ba1\u7406\u9762\u677f-\u6587\u4ef6\u7ba1\u7406,\u8fdb\u5165public_html,\u65b0\u5efa\u4e00\u4e2a\u6587\u4ef6\u547d\u540d\u4e3a.htaccess\u6587\u4ef6,\u4fdd\u5b58\u5373\u53ef\u3002 \u7f16\u8f91.htaccess\u6587\u4ef6\u5199\u5165\u4ee5\u4e0b\u89c4\u5219\uff1a RewriteBase \/ RewriteCond %{SERVER_PORT} !^443$ RewriteRul&#8230; <a href=\"https:\/\/www.ldhost.cn\/jc\/weberror\/1650.html\" class=\"readmore\">\u9605\u8bfb\u5168\u6587<span class=\"screen-reader-text\">\u5b89\u88c5SSL\u8bc1\u4e66\u540e\u8bbe\u7f6e301\u8df3\u8f6c\u5c06http\u8df3\u8f6c\u5230https\u65b9\u6cd5<\/span><span class=\"fa fa-angle-double-right\" aria-hidden=\"true\"><\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[],"class_list":["post-1650","post","type-post","status-publish","format-standard","hentry","category-weberror","content-layout-excerpt-thumb"],"_links":{"self":[{"href":"https:\/\/www.ldhost.cn\/jc\/wp-json\/wp\/v2\/posts\/1650","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ldhost.cn\/jc\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ldhost.cn\/jc\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ldhost.cn\/jc\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ldhost.cn\/jc\/wp-json\/wp\/v2\/comments?post=1650"}],"version-history":[{"count":14,"href":"https:\/\/www.ldhost.cn\/jc\/wp-json\/wp\/v2\/posts\/1650\/revisions"}],"predecessor-version":[{"id":13758,"href":"https:\/\/www.ldhost.cn\/jc\/wp-json\/wp\/v2\/posts\/1650\/revisions\/13758"}],"wp:attachment":[{"href":"https:\/\/www.ldhost.cn\/jc\/wp-json\/wp\/v2\/media?parent=1650"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ldhost.cn\/jc\/wp-json\/wp\/v2\/categories?post=1650"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ldhost.cn\/jc\/wp-json\/wp\/v2\/tags?post=1650"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}