我当前的域名是一个免费的https。
我添加了新的域名作为驻留域名的别名(在DirectAdmin中)。
因此,对于使用https的新域,我需要禁用旧域的https。
现在,我想使用https将所有旧域名转移到新域。
我认为解决方案是除了新域之外的所有域都应该禁用https,然后将地址转移到新域
发布于 2019-04-20 16:59:09
您可以像这样强制使用https:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]它应该转到根文件夹的.htaccess
来源:https://www.siteground.com/kb/how-to-force-ssl-with-htaccess/
发布于 2019-04-20 17:21:04
您可以使用以下命令:
RewriteEngine on
RewriteCond %{HTTP_HOST} !^(www\.)?newdomain\.com$ [NC]
RewriteRule (.*) https://www.newdomain.com/$1 [L,R=301]这会将所有驻留的域名(指向您的文档根目录)重定向到您的新域url。
上面的RewriteCondition确保您不会将newdoman重定向到自身,否则该规则将导致重定向循环错误。
https://stackoverflow.com/questions/55771803
复制相似问题