我已经查看了这个特定问题的堆栈溢出,但还没有找到它,所以我要问 . 我们有两个域名 . 我在.htaccess中进行了301重定向,它就像一个魅力:

RewriteCond %{HTTP_HOST} ^olddomain.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.olddomain.com$ [OR]
    RewriteCond %{HTTP_HOST} ^newdomain.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.newdomain.com$ [OR]
    RewriteRule (.*)$ https://www.newdomain.com/$1 [R=301,L]

我们的想法是将所有流量 - http和https重定向到https newdomain.com . 到目前为止,它将http请求重定向到https newdomain.com,但不会将https olddomain.com重定向到https newdomain.com .

您是否知道如何使用.htaccess使https olddomain.com执行301重定向到https newdomain.com?

提前致谢 .