开发者

In Apache .htaccess file using mod_rewrite, is it possible to force www AND force https for a domain?

RewriteCond %{HTTP_HOST} !^www.example.co.uk$ [NC] 
RewriteRule ^(.*)$ https://www.example.co.uk/$1 [R开发者_如何学JAVA=301,QSA,L] 

thats for the www, but I cannot figure out in a one-pass way how to force the https too?


Use the SERVER_PROTOCOL variable:

RewriteCond ${SERVER_PROTOCOL} !^https [NC]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜