IIS URL重写:只重定向域,不重定向子文件夹



我有一个域名example.com,我只想将这些确切的域名重定向到new-example.com。

所有子文件夹都重定向到不同的域。这很好。

但是,我如何才能实现只重定向example.com?

我有这个,但我不工作。

<rule name="Redirect Rule example.com" stopProcessing="true">
<match url="^/$" />       
<action type="Redirect" url="https://www.new-example.com" appendQueryString="False" redirectType="Permanent" />
</rule> 

我想我得到了错误。

它需要

<rule name="Redirect Rule example.com" stopProcessing="true">
<match url="^$" />       
<action type="Redirect" url="https://www.new-example.com" appendQueryString="False" redirectType="Permanent" />