简体   繁体   English

使用IIS7 URL重写模块将其他域重定向到主.com域

[英]Redirect additional domains to main .com domain using IIS7 URL Rewrite Module

如何在IIS7中配置URL重写规则以将我的aditional域(domain.net,domain.org,domain.info)重定向到主体.com域?

In IIS7, you can use the new command “appcmd.exe” to enable redirection as following: 在IIS7中,您可以使用新命令“appcmd.exe”启用重定向,如下所示:

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

This tells IIS to redirect all request sending to the virtual application “/” to “ http://domain.com ”. 这告诉IIS将发送到虚拟应用程序“/”的所有请求重定向到“ http://domain.com ”。 The actual result is that appcmd.exe adds the following section to the web.config file for “/”: 实际结果是appcmd.exe将以下部分添加到“/”的web.config文件中:

web.config of your domain.net 你的domain.net的web.config

<system.webServer>

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

</system.webServer>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM