IIS URL Rewrite redirect from one Domain to another
IIS URL Rewrite enables Web administrators to create powerful rules to implement URLs that are easier for users to remember and easier for search engines to find.
For more information you can read the below url: http://www.iis.net/downloads/microsoft/url-rewrite
See the below example redirect from one Domain to another:

IIS URL Rewrite will add the rewrite rules into web.config
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Domain switch" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="(www.)?site1.com" />
</conditions>
<action type="Redirect" url="http://www.site2.nl/{R:0}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
How can we skip the "/page" when we redirect one Domain to another?
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Domain switch" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="(www.)?site1.com" />
<add input="{URL}" pattern="^/page.*" negate="true" />
</conditions>
<action type="Redirect" url="http://www.site2.nl/{R:0}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
How can we redirect non-www to www?
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Redirect non-www to www" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^site.com$" />
</conditions>
<action type="Redirect" url="http://www.site.com/{R:0}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
IIS URL Rewrite redirect from one Domain to another的更多相关文章
- IIS URL Rewrite – Installation and Use
IIS URL Rewrite – Installation and Use Posted by Nick LeFevre | Leave a reply IIS URL Rewrite Instal ...
- IIS URL Rewrite Module防盗链规则配置方法
IIS版本:IIS 7.5 URL Rewrite组件:IIS URL Rewrite Module(http://www.iis.net/downloads/microsoft/url-rewrit ...
- IIS URL Rewrite(URL 重写)-使用教程
IIS URL Rewrite(URL 重写)-使用教程 作者:vkvi 来源:千一网络(原创) 日期:2011-8-17 http://www.cftea.com/c/2011/08/9CRXOL ...
- Windows10中的IIS10安装php manager和IIS URL Rewrite 2.0组件的方法
Windows10中自带的Server:Microsoft-IIS/10.0,然后这个10却让原本支持组件无法安装了,php manager组件安装时提示“必须安装IIS7以上才可以安装”.那是不是真 ...
- IIS URL Rewrite Module的防盗链规则设置
IIS版本:IIS 7.5 URL Rewrite组件:IIS URL Rewrite Module(http://www.iis.net/downloads/microsoft/url-rewrit ...
- Windows10 IIS安装php manager和IIS URL Rewrite 2.0组件的方法
Windows10中自带的Server:Microsoft-IIS///8.5/10上安装.微软脑子秀逗,跳过了9,以为能解决版本识别的问题,没想到弄成10,还是出现了版本识别的问题,真是自己打自己的 ...
- IIS:URL Rewrite实现vue的地址重写
vue-router 全局配置 const router = new VueRouter({ mode: 'history', routes: [...] }) URL Rewrite 1.添加规则 ...
- iis url rewrite http->https non-www->www
<system.webServer> <rewrite> <rules> <rule name="Redirect abc.com to www&q ...
- IIS 7.5 使用URL Rewrite模块简单设置网页跳转
原文 IIS 7.5 使用URL Rewrite模块简单设置网页跳转 我们都知道Apache可以在配置文件里方便的设置针对网页或网站的rewrite,但是最近接手了一组IIS服务器,发现这货简单的没有 ...
随机推荐
- Nvidia Anisotropic Lighting
http://http.download.nvidia.com/developer/SDK/Individual_Samples/DEMOS/Direct3D9/HLSL_Aniso.zip Anis ...
- Archlinux 简明安装指南
archlinux是在distrowatch里位于top 10的发行版中,唯一采用roll release的distribution. pacman和yaourt双剑合壁,使得在archlinux安装 ...
- 转载:C/C++源代码到可执行程序的过程详解
C/C++源代码到可执行程序的过程详解 编译,编译程序读取源程序(字符流),对之进行词法和语法的分析,将高级语言指令转换为功能等效的汇编代码,再由汇编程序转换为机器语言,并且按照操作系统对可执行文件格 ...
- 【IOS笔记】Event Delivery: The Responder Chain
Event Delivery: The Responder Chain 事件分发--响应链 When you design your app, it’s likely that you want t ...
- sad
1.really sad about sth 2.really sad to hear sth 3.upset /unhappy about sth 4.a little down 5.down in ...
- FloodLight使用感受
一个使用java语言编写的基于Openflow协议的SDN控制器. 基本架构同webserver一样,有一个维护交换机连接信息的底层模块,当有交换机同控制器连接时,floodlight会将此连接保存到 ...
- Mysql操作笔记(持续更新)
1.mysqldump备份导出 备份成sql mysqldump -hlocalIp -uuserName -p --opt --default-character-set=utf8 --hex-bl ...
- CDH介绍
本文引用自:Cloudera 系列2:CDH介绍http://www.aboutyun.com/thread-18379-1-1.html(出处: about云开发) CDH提供: 灵活性-存储任何类 ...
- [LeetCode] Decode Ways(DP)
A message containing letters from A-Z is being encoded to numbers using the following mapping: 'A' - ...
- Eclipse 常用整理
1.编译 eclipse默认是修改程序后自动编译的,如果不能自动编译,你可以查看project->build automatically选项是否被选中. 手动编译整个工程,可以使用Project ...