域仅作为https(wordpress)

时间:2015-04-22 00:08:30

标签: wordpress .htaccess ssl https rewrite

我有以下域名,只会加载" https:"正确地

在没有https的域上时出现以下错误:内部错误:缺少模板ERR_CONNECT_FAIL

任何关于在哪里寻找的提示或可能的方向将不胜感激。尝试了很多不同的事情,到目前为止没有结果

1 个答案:

答案 0 :(得分:0)

试试这个。

     RewriteCond %{HTTPS} off
    # First rewrite to HTTPS:
    # Don't put www. here. If it is already there it will be included, if not
    # the subsequent rule will catch it.
    RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    # Now, rewrite any request to the wrong domain to use www.
    RewriteCond %{HTTP_HOST} !^www\.
    RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

它只会将用户重定向到ssl页面。暂时保存您的网站。