我在同一个虚拟主机上运行 2 个域
<VirtualHost *:80>
ServerName www.example.de
ServerAlias www.example.de example.de example.co.uk www.example.co.uk
DocumentRoot C:/inetpub/wwwroot/example_ml
DirectoryIndex index.php
</VirtualHost>
并尝试在我的 htaccess 中为两个域应用相同的重定向规则
RewriteRule ^tag/(.*)$ http://www.example.de/$1 [L,R=301]
RewriteRule ^\d{4}/\d{2}/\d{2}/(.*)$ http://www.example.de/$1 [L,R=301]
RewriteRule ^\d{4}/\d{2}/(.*)$ http://www.example.de/$1 [L,R=301]
RewriteRule ^tag/(.*)$ http://www.example.co.uk/$1 [L,R=301]
RewriteRule ^\d{4}/\d{2}/\d{2}/(.*)$ http://www.example.co.uk/$1 [L,R=301]
RewriteRule ^\d{4}/\d{2}/(.*)$ http://www.example.co.uk/$1 [L,R=301]
但似乎不适用于example.co.uk/tag_name
我被重定向到的每一个example.de/tag_name