0

我如何将 .htaccess 文件写入https://www.domain.com

例子

domain.com => https://www.domain.com
www.domain.com => https://www.domain.com
https://domain.com => https://www.domain.com
http://www.domain.com => https://www.domain.com
4

2 回答 2

2

尝试以下规则:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
于 2012-09-05T20:41:13.147 回答
0
Options +FollowSymlinks
RewriteEngine on

RewriteRule ^(.*)$ https://www.domain.com/$1 [R=301,L]

这是我使用的代码。我也在http://htaccess.madewithlove.be/上查看过:)

于 2012-09-05T20:38:53.330 回答