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的更多相关文章

  1. IIS URL Rewrite – Installation and Use

    IIS URL Rewrite – Installation and Use Posted by Nick LeFevre | Leave a reply IIS URL Rewrite Instal ...

  2. IIS URL Rewrite Module防盗链规则配置方法

    IIS版本:IIS 7.5 URL Rewrite组件:IIS URL Rewrite Module(http://www.iis.net/downloads/microsoft/url-rewrit ...

  3. IIS URL Rewrite(URL 重写)-使用教程

    IIS URL Rewrite(URL 重写)-使用教程 作者:vkvi 来源:千一网络(原创) 日期:2011-8-17  http://www.cftea.com/c/2011/08/9CRXOL ...

  4. Windows10中的IIS10安装php manager和IIS URL Rewrite 2.0组件的方法

    Windows10中自带的Server:Microsoft-IIS/10.0,然后这个10却让原本支持组件无法安装了,php manager组件安装时提示“必须安装IIS7以上才可以安装”.那是不是真 ...

  5. IIS URL Rewrite Module的防盗链规则设置

    IIS版本:IIS 7.5 URL Rewrite组件:IIS URL Rewrite Module(http://www.iis.net/downloads/microsoft/url-rewrit ...

  6. Windows10 IIS安装php manager和IIS URL Rewrite 2.0组件的方法

    Windows10中自带的Server:Microsoft-IIS///8.5/10上安装.微软脑子秀逗,跳过了9,以为能解决版本识别的问题,没想到弄成10,还是出现了版本识别的问题,真是自己打自己的 ...

  7. IIS:URL Rewrite实现vue的地址重写

    vue-router 全局配置 const router = new VueRouter({ mode: 'history', routes: [...] }) URL Rewrite 1.添加规则 ...

  8. iis url rewrite http->https non-www->www

    <system.webServer> <rewrite> <rules> <rule name="Redirect abc.com to www&q ...

  9. IIS 7.5 使用URL Rewrite模块简单设置网页跳转

    原文 IIS 7.5 使用URL Rewrite模块简单设置网页跳转 我们都知道Apache可以在配置文件里方便的设置针对网页或网站的rewrite,但是最近接手了一组IIS服务器,发现这货简单的没有 ...

随机推荐

  1. js 表单内容使用ajax以json格式混合提交

    脚本代码 function submitForm(){    var post_data = $("#form1").getdict();    var data_dict = { ...

  2. 为什么我的联想打印机M7450F换完墨粉之后打印机显示请更换墨粉盒?这是我的墨盒第一次灌粉·、

    需要打印机清零,可以网上查到的,要不就去买颗芯片换上关掉机器 →开机的同时按住功能按扭不松手开机→进入维修模式→翻到84功能项→按OK→用下翻键找到PROCESS CHECK→按OK 按扭→关机→正常 ...

  3. laravel md5+salt 密码

    laravel 默认用的登录密码加密方式是: $password = Hash::make('password'); 修改密码加密方式为: $password = md5('password'.'sa ...

  4. java 重写 重载

    首先我们来讲讲:重载(Overloading) (1) 方法重载是让类以统一的方式处理不同类型数据的一种手段.多个同名函数同时存在,具有不同的参数个数/类型. 重载Overloading是一个类中多态 ...

  5. App之百度云推送

    集成SDK 下载最新的Android SDK压缩包并解压,在新建工程或已有工程中增加百度云推送功能. 我下载的是 ,里面有一个同名的文件夹,文件夹中有 导入云推送jar包和so文件: 将解压后的lib ...

  6. memache session

    Memcache和PHP memcach扩展安装请见http://koda.iteye.com/blog/665761 设置session用memcache来存储 方法I: 在 php.ini 中全局 ...

  7. VS附加到进程调试的方法及应用场景

    应用场景:.Net做网站时,代码量很大的时候,每次调试一个网页都编译整个网站是不显示的,而且有时候整个网站是存在错误的,通不过编译.这时你又要调试某部分网页,就可以通过附加到进程调试.方法如下: (1 ...

  8. 蓝牙Bluetooth技术手册规范下载

    [背景] 之前就已经整理和转帖了和蓝牙技术相关的一些内容: [资源下载]bluetooth 协议 spec specification 蓝牙1.1.蓝牙1.2.蓝牙2.0(蓝牙2.0+EDR)区别 但 ...

  9. MySQL- 锁(1)

    锁是计算机协调多个进程或线程并发访问某一资源的机制.在数据库中,除传统的计算资源(如CPU.RAM.I/O等)的争用以外,数据也是一种供许多用户共享的资源.如何保证数据并发访问的一致性.有效性是所有数 ...

  10. The Four Stages of Recovering a Project

    If a project is in trouble, the project manager needs to work to recover it and get the schedule bac ...