我想将http://cpanel.domain.com重定向到https://cpanel.domain.com我该怎么办?
我尝试了这个,但它不适用于cPanel,仅适用于domain.com:
RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
下面的代码是将HTTP
重定向到HTTPS
所需要的。
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
将此代码添加到.htaccess文件中RewriteEngine开RewriteCond%{SERVER_PORT} 80RewriteRule ^(。*)$https://www.yourdomain.com/$ 1 [R,L]