asp.net 多个域名重定向,在web.Config中配置
2016-05-26 14:04
686 查看
一个网站有多个域名,但是需要在访问其中某个域名之后跳转到另一域名。
Web.config 中配置
Web.config 中配置
</system.webServer> <!--重定向 域名 开始--> <rewrite> <rules> <rule name="a0001 301 Redirect" stopProcessing="true"> <match url=".*" /> <conditions> <add input="{HTTP_HOST}" pattern="^a0001.com$" /> </conditions> <action type="Redirect" url="http://www.d0004.com/{R:0}" redirectType="Permanent" /> </rule> <rule name="www jdqp 301 Redirect" stopProcessing="true"> <match url=".*" /> <conditions> <add input="{HTTP_HOST}" pattern="^www.a0001.com$" /> </conditions> <action type="Redirect" url="http://www.d0004.com/{R:0}" redirectType="Permanent" /> </rule> <rule name= "b0002 301 Redirect" stopProcessing="true"> <match url=".*" /> <conditions> <add input="{HTTP_HOST}" pattern="^b0002.com$" /> </conditions> <action type="Redirect" url="http://www.d0004.com/{R:0}" redirectType="Permanent" /> </rule> <rule name="www b0002 301 Redirect" stopProcessing="true"> <match url=".*" /> <conditions> <add input="{HTTP_HOST}" pattern="^www.b0002.com$" /> </conditions> <action type="Redirect" url="http://www.d0004.com/{R:0}" redirectType="Permanent" /> </rule> </rules> </rewrite> <!--重定向 域名 结束--> </system.webServer>
相关文章推荐
- Java代理之(jdk静态代理/jdk动态代理/cglib动态代理/aop/aspectj)
- Asp.net MVC 之请求生命周期
- Error occurred initialization of VM Could not allocate metaspac:xxx bytes发生时
- ASP.NET MVC学习系列(二)-WebAPI请求(转)
- asp.net控件,服务器标记的格式不正确问题解决方法
- ASP.NET Web API 使用Swagger生成在线帮助测试文档
- Asp.Net MVC 4 Web API 中的安全认证-使用OAuth
- ASP.NET Core 开发-中间件(Middleware)
- 微信扫码支付+Asp.Net MVC
- ASP.NET Web API 安全验证之摘要(Digest)认证
- ASP.NET的Cookie和Session
- aspx后台传递Json到前台的两种接收方法推荐
- Asp.Net 操作XML文件的增删改查 利用GridView
- Asp.Net Core-几行代码解决Razor中的嵌套if语句
- 适用于asp.net的一个转盘抽奖源码
- ASP网站挂木马怎么办?
- ASP.NET使用Fileupload时网页报错提示“连接已重置”
- ASP.NET MVC 模块与组件(二)——定制图片验证码
- vs2010 用户控件拖到aspx页面不可用
- 关于asp.net中页面事件加载的先后顺序