RewriteCond 排除域

RewriteCond excluding domain

我正在为 .htaccess 中的 RewriteCond 而苦苦挣扎

我必须将我的所有域 (domain1.com ; domain2.com ; domain3.com) 重定向 301 到单个域 (x1x1x1.com) 除了 1 (domain4.com)

我必须使用 RewriteCond 来排除 domain4.com 还是可以在 RewriteRule 中立即排除它?

我试过:

<IfModule mod_rewrite.c>

RewriteEngine on

RewriteCond %{HTTP_HOST} ^domain4\.com [NC,OR]
RewriteCond %{HTTP_HOST} ^www\.domain4\.com [NC]

RewriteRule ^(.*)$ https://x1x1x1.com/ [R=301,L]

</IfModule>

谢谢大家

像这样...

<IfModule mod_rewrite.c>

RewriteEngine On 
RewriteCond %{HTTP_HOST} !domain4.com [NC]
RewriteRule ^ https://x1x1x1.com/

</IfModule>