我如何将 .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
我如何将 .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
尝试以下规则:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.*)$ https://www.domain.com/$1 [R=301,L]
这是我使用的代码。我也在http://htaccess.madewithlove.be/上查看过:)