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服务器,发现这货简单的没有 ...
随机推荐
- PHP+jQuery 注册模块的改进之二:激活链接的URL设置与有效期
接<PHP+jQuery 注册模块的改进之一>继续修改: ①在注册成功后返回登录邮件页面( maillogin.php ),在页面中用户可以点击链接跳转到自己注册邮箱的登录页面,可以再次发 ...
- maven编译项目理解
如何运行这个Web项目? 右键项目名称,在弹出的选项中选择 Run As => Maven install,然后 Eclise 会下载并安装相关依赖包.在等待一段时间后,构建成功的结果如下:
- skype msnLite 静态路由
连接vpn后防止skype和msn重复登陆 route -p add ip网段 mask 子网掩码 本地网管 skyperoute -p add 91.0.0.0 mask 255.0.0.0 192 ...
- [收藏] 关于解决“进程com.android.phone意外停止”的方法 (未尝试)
很多机油反应有这个情况,本人费劲九牛20虎之力终于克服之,这个现象一般出现在刚刷完系统会出现,甚至你怎么刷ROM这个现象依旧存在(崩溃不?)~~~有位机油刷了这个系统也出现了http://samsun ...
- java 时间戳和PHP时间戳 的转换
java 时间戳和PHP时间戳 的转换 PHPJava 总结一下java 时间戳和PHP时间戳 的转换问题: 由于精度不同,导致长度不一致,直接转换错误. JAVA时间戳长度是13位,如:12948 ...
- 一看就懂的Android APP开发入门教程
一看就懂的Android APP开发入门教程 作者: 字体:[增加 减小] 类型:转载 这篇文章主要介绍了Android APP开发入门教程,从SDK下载.开发环境搭建.代码编写.APP打包等步骤 ...
- add user
ubuntu adduser deploy usermod -a -G sudo deploy centos adduser deploy passwd deploy usermod -a -G wh ...
- 11号了,还有三天上线-改bug
+(NSDictionary *)replacedKeyFromPropertyName { return @{ @"doctorId": @"id" }; ...
- Environment Variables
https://msdn.microsoft.com/en-us/library/windows/desktop/ms682653(v=vs.85).aspx Every process has an ...
- maven 的一些基本操作
maven install :把打出的包装载到本地仓库,package:是打包的意思 每当项目中的模块里的东西发生变化的时候,先install一下项目 ,在启用maven的tomcat插件就不会报错 ...