2017-04-21 52 views
1

我已经安装在域的SSL证书我与测试和SSL运作的,你可以在这里看到:https://naughtyrobot.co.uk/ - 我也验证了我的域名在这里有一个有效的SSL证书:https://www.ssllabs.com/ssltest/analyze.html?d=naughtyrobot.co.uk的.htaccess HTTPS重定向失败

我已经在根目录下创建一个.htaccess文件,它看起来像这样:

RewriteCond %{ENV:SSL} ^$ [OR] 
RewriteCond %{HTTP_HOST} !^www\.naughtyrobot\.co.uk 
RewriteRule (.*) https://naughtyrobot.co.uk/$1 [R=301,L] 

我检查,以确保根是正确的通过看:etc/apache2/sites-enabled/000-default-le-ssl.conf

但是,如果你访问naughtyrobot.co.uk我Ť似乎只是路线标准http://

回答

1

更改您的规则是:

RewriteEngine On 

RewriteCond %{HTTPS} off 
RewriteRule^https://naughtyrobot.co.uk%{REQUEST_URI} [R=301,L,NE]