asp.net 多个域名重定向,在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>
asp.net 多个域名重定向,在web.Config中配置的更多相关文章
- web.config中配置数据库(多数据)连接的两种方式
这是我的第一篇文章,既然是第一篇了,那就从最基础的只是说起--web.config中配置数据库连接. 网上有很多这方面的资料,但发现并没有一篇从头到位很清楚明了说完的,今天就把我的整理写在这里吧. 在 ...
- 在Web.config中配置handler
在Web.config中配置handler节点时发现用vs2010和用vs2015竟然不一样,经过多次测试发现了一些倪端: <configuration> <!--vs2010中需要 ...
- web.config中配置页面出错后跳转指定错误页面
每当用户访问错误页面时,会出现不友好的404错误,所以为了防止这种不友好,我们在web.config中的<system.web>节点下配置 <customErrors>,在出现 ...
- membership 在web.config中配置信息
<?xml version="1.0" encoding="utf-8"?><configuration> <configSect ...
- c# MVC在WEB.Config中配置MIME
在IIS中,默认没有添加.json格式的MIME,所有无法读取服务器中的.json格式的文件,返回结果404 方式一:在IIS中手动添加MIME 1.点击MIME进入MIME列表 2.添加MIME 3 ...
- Web.Config中配置字符串含引号的处理
配置文件中往往要用到一些特殊的字符, Web.Config默认编码格式为UTF-8,对于XML文件,要用到实体转义码来替换.对应关系如下: 字符 转义码 & 符号 & & 单引 ...
- 在web.config中配置httpHandlers节点是的说明
<system.web> <httpHandlers> <add verb="*" path="*.lcj" type=" ...
- web.config中配置数据库连接的两种方式
在ASP.NET中有两种配置数据库连接代码的方式,它们分别是 appSettings 和 connectionStrings .在使用 appSettings 和 connectionStrings ...
- .net web.config中配置字符串中特殊字符的处理
https://www.cnblogs.com/zzmzaizai/archive/2008/01/30/1059191.html 如果本身字符串中有特殊字符,如分号,此时就需要用单引号整体包裹起来, ...
随机推荐
- Netty4 自定义Decoder,Encoder进行对象传递
首先我们必须知道Tcp粘包和拆包的,TCP是个“流”协议,所谓流,就是没有界限的一串数据,TCP底层并不了解上层业务数据的具体含义,它会根据TCP缓冲区的实际数据进行包的划分,一个完整的包可能会被拆分 ...
- 2013 ACM/ICPC Asia Regional Online —— Warmup2
HDU 4716 A Computer Graphics Problem 水题.略 HDU 4717 The Moving Points 题目:给出n个点的起始位置以及速度矢量,问任意一个时刻使得最远 ...
- 转: 在线office的协作工具列表
产品完备性.协作功能.功能完备性对比 <img src="https://pic2.zhimg.com/af14a86eedcb93962e41e47788de5989_b.p ...
- 何为 ISAPI
ISAPI即为Internet Server Application Programming Interface ISAPI 服务器扩展 ISAPI 服务器扩展是可以被 HTTP 服务器加载和调用的 ...
- What Makes a Good Programmer Good?
I’ve worked with a lot of programmers over the years — some of them super amazing, and some distinct ...
- fitsSystemWindow作用
fitsSystemWindows layout属性 英文文档注释为: Boolean internal attribute to adjust view layout based on system ...
- php读取目录下的文件
工作需要写了一个读取指定目录下的文件,并显示列表,点击之后读取文件中的内容 高手拍砖,目录可以自由指定,我这里直接写的是获取当前文件目录下面的所有文件 <?php /** * 读取指定目录下面的 ...
- MVC 开启gzip压缩
using System.IO; using System.IO.Compression; using System.Web; using System.Web.Mvc; public class C ...
- MongoDB中的group
在Mongodb的查询中,有类似于SQL中group by功能的group函数.两者的功能有些类似,但是区别也是比较明显的. 对于SQL来说,group by的作用就是安装依据列来将数据表中的记录分成 ...
- python 实现梯度下降
在多元线性回归中会用到梯度下降来计算参数值.这里我用python实现一个梯度下降版本. 这里多元线性方程为 y = A0+A1*x1+...+An* xn 数据输入格式,y表示 y \t x1 \t ...