3

我应该如何在 IIS7 中配置 URL 重写规则以将我的附加域(domain.net、domain.org、domain.info)重定向到主要的 .com 域?

4

1 回答 1

2

在 IIS7 中,您可以使用新命令“appcmd.exe”来启用重定向,如下所示:

%windir%\system32\inetsrv\appcmd set config "Default Web Site/" -section:system.webServer/httpRedirect -enabled:true -destination:"http://domain.com"

这告诉 IIS 将发送到虚拟应用程序“/”的所有请求重定向到“<a href="http://domain.com" rel="nofollow noreferrer">http://domain.com”。实际结果是 appcmd.exe 在 web.config 文件中为“/”添加了以下部分:

您 domain.net 的 web.config

<system.webServer>

    <httpRedirect enabled="true" destination="http://domain.com" httpResponseStatus="Permanent"/>

</system.webServer>
于 2009-02-09T20:25:53.357 回答