码迷,mamicode.com
首页 > Web开发 > 详细

IIS URL Rewrite redirect from one Domain to another

时间:2015-10-22 00:18:53      阅读:233      评论:0      收藏:0      [点我收藏+]

标签:

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>

 

IIS URL Rewrite redirect from one Domain to another

标签:

原文地址:http://www.cnblogs.com/zhangpengc/p/4899471.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!