.htaccess XML多域站点地图重定向

.htaccess XML多域站点地图重定向,.htaccess,drupal-8,sitemap,.htaccess,Drupal 8,Sitemap,我的主页可以通过两个不同的域访问 1: 2: 我为每个站点手动创建了sitemap.xml,它位于我页面的根目录中。(sitemap1.xml/sitemap2.xml) 输入URLexample.at/sitemap.xml或example.de/sitemap.xml后,我需要重定向到正确的.xml文件 1:=> 2:=> 我尝试了以下重定向规则: RewriteCond %{REQUEST_URI} ^\/sitemap\.xml$ RewriteRule .* https://examp

我的主页可以通过两个不同的域访问

1:

2:

我为每个站点手动创建了sitemap.xml,它位于我页面的根目录中。(sitemap1.xml/sitemap2.xml

输入URLexample.at/sitemap.xmlexample.de/sitemap.xml后,我需要重定向到正确的.xml文件

1:=>

2:=>

我尝试了以下重定向规则:

RewriteCond %{REQUEST_URI} ^\/sitemap\.xml$
RewriteRule .* https://example.at/sitemap1.xml [R=301,L]

RewriteCond %{REQUEST_URI} ^\/sitemap\.xml$
RewriteRule .* https://example.de/sitemap2.xml [R=301,L]
无论我输入.de.at地址,我都将被转发到:

我没有重写规则的经验,因此我使用:

非常感谢您的帮助

提前谢谢

RewriteCond %{HTTP_HOST} ^example.at$
RewriteCond %{REQUEST_URI} /sitemap.xml
RewriteRule ^(.*)$ https://example.at/sitemap1.xml [R=301,L]

RewriteCond %{HTTP_HOST} ^example.de$
RewriteCond %{REQUEST_URI} /sitemap.xml
RewriteRule ^(.*)$ https://example.de/sitemap2.xml [R=301,L]
编辑:可能是缓存问题