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服务器,发现这货简单的没有 ...
随机推荐
- Maven 创建多模块工程
1. 创建父项目 new -->project-->maven-->maven Project,然后下一步, 进入new maven Project的Select project n ...
- C++的函数名重载
#include <iostream> using namespace std; int func(int c) { cout<<"int func(int c)&q ...
- TI CC2541 BLE协议栈蓝牙MAC 地址
在Flash中有一块只读区域,从地址0x780E开始,蓝牙的MAC以小端方式存放在里面. 在TI的Peripheral例程里面,添加一个特征值,只读属性,6字节长度(蓝牙MAC长度为48-bit,6字 ...
- JS Date函数操作
1. 补充Format函数 // common functionsstart Date.prototype.Format = function(fmt) { //author: meizz var o ...
- ubuntu lnmp
apt-get update apt-get upgrade apt-get install libxml2 libxml2-dev apt-get install make apt-get inst ...
- 灰度图像 Grayscale Binary_image
https://en.wikipedia.org/wiki/Grayscale https://zh.wikipedia.org/wiki/灰度图像 In photography and comput ...
- Nginx 上的 php-fpm 资源侵占问题
测试人员向我们反映:在Facebook平台的游戏比其它平台的游戏明显更慢.我询问,是不是因为FQ网络原因.他们说:不是,其它游戏也比较流畅.使用httpwatch查看了http请求,发现api.php ...
- android ArrayAdapter 如何动态更改数据
在android开发中ListView是比较常用的组件,它以列表的形式展示具体内容,并且能够根据数据的长度自适应显示,使用adpater与listview捆绑后,有时希望在程序使用过程中能动态的更改l ...
- eclipse Maven -->web project
http://blog.chinaunix.net/uid-26959955-id-3248053.html http://blog.csdn.net/wilsonke/article/details ...
- Google物联网操作系统协同框架Weave深度解析
1. Google Weave框架 在2015年的Google I/O大会上,负责Android业务的桑达.皮查伊(SundarPichai)宣布了Google最新的物联网战略.这包括一个 ...