-1
我嘗試使用的.htaccess,但它不工作 我的代碼是當我在我的網站上安裝SSL證書,請告訴我如何重定向HTTP到HTTPS
RewriteEngine on
RewriteCond %{HTTPS} !=on [NC]
RewriteRule ^(.*)$ https://mosaicwebsolution.com/$1 [R=301,L]
我嘗試使用的.htaccess,但它不工作 我的代碼是當我在我的網站上安裝SSL證書,請告訴我如何重定向HTTP到HTTPS
RewriteEngine on
RewriteCond %{HTTPS} !=on [NC]
RewriteRule ^(.*)$ https://mosaicwebsolution.com/$1 [R=301,L]
如果你可以改變你的虛擬主機,這是最簡單的方法:
Redirect permanent/https://mosaicwebsolution.com/
實施例:
<VirtualHost *:80>
ServerName mosaicwebsolution.com
ServerAlias www.mosaicwebsolution.com
Redirect permanent/https://www.mosaicwebsolution.com/
</VirtualHost>