标签: apache ssl https rewrite
RewriteCond %{HTTP_HOST} !^www.example.co.uk$ [NC] RewriteRule ^(.*)$ https://www.example.co.uk/$1 [R=301,QSA,L]
那是www的,但我无法弄清楚如何强制https?
答案 0 :(得分:1)
使用SERVER_PROTOCOL变量:
RewriteCond ${SERVER_PROTOCOL} !^https [NC]