使用IIS7 URL重写模块重定向到主.com域中其他域 [英] Redirect additional domains to main .com domain using IIS7 URL Rewrite Module

查看:221
本文介绍了使用IIS7 URL重写模块重定向到主.com域中其他域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

How should I configure the URL Rewrite Rule in IIS7 to redirect my aditional domains ( domain.net, domain.org, domain.info) to the principal .com domain?

推荐答案

在IIS7,您可以使用新的命令Appcmd.exe的启用重定向如下:

In IIS7, you can use the new command "appcmd.exe" to enable redirection as following:

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

这告诉IIS重定向请求全部发送到虚拟应用程序/到 http://domain.com 。实际的结果是,Appcmd.exe的增加以下部分的web.config文件/:

This tells IIS to redirect all request sending to the virtual application "/" to "http://domain.com". The actual result is that appcmd.exe adds the following section to the web.config file for "/":

您domain.net的web.config文件

web.config of your domain.net

<system.webServer>

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

</system.webServer>

这篇关于使用IIS7 URL重写模块重定向到主.com域中其他域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆