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 如果本身字符串中有特殊字符,如分号,此时就需要用单引号整体包裹起来, ...
随机推荐
- cordova在app内部指定浏览器打开链接插件:cordova-plugin-inappbrowser
原文网址:http://www.ncloud.hk/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/cordova-plugin-inappbrowser/ 要想App里边的 ...
- CF Two Substrings
Two Substrings time limit per test 2 seconds memory limit per test 256 megabytes input standard inpu ...
- hdu 4055 动态规划
#include<map> #include<set> #include<cmath> #include<queue> #include<cstd ...
- hdu 4412 利用单调性的动态规划
思路: 这题和1227的求法一样,只不过1227是小数据,暴力下,就能进行预处理. 这题的预处理区间期望cost[i][j]需要利用单调性. 即假使以pos位置为安排的点,那么这个区间在其左边的概率为 ...
- hdu 1243 反恐训练营 最长公共字序列
此题的题意很明确,就是求最长公共子序列: #include<iostream> #include<algorithm> #include<cstdio> #incl ...
- CF 107E 多边形面积并
107E Darts 题目:给出n个矩形,问落在n个矩形交的部分的概率 分析:裸的多边形面积并. 代码略..
- 访问iPhone通讯录的问题
每个APP只显示一次上图的提示,即使卸载APP也不显示.如果想再次显示提示,可进入 设置-->通用-->还原-->还原位置与隐私,即可. 而且在ios6中文环境下,访问通讯录会出现错 ...
- 如果AlertView输入框为空,则禁止点击确定按钮
//UIAlertView的代理方法(创建UIAlertView之后,copy此代理方法即可) - (BOOL)alertViewShouldEnableFirstOtherButton:(UIAle ...
- sql的基本用法-------修改字段默认值和属性
修改表中已有的字段属性 ALTER TABLE 表名 ALTER COLUMN 字段名 varchar(500) --sqlserver建表表时设置字段的默认值 create table 表(id i ...
- Part 17 Temporary tables in SQL Server
Temporary tables in SQL Server