开发者

How to redirect in IIS7 for this url format

开发者 https://www.devze.com 2023-03-22 02:46 出处:网络
I wonder how to do specific redirection based on the scenario below? When people open 开发者_如何转开发this url at browser http://www.test.com/gotogoogle it will redirect them to http://www.google.co

I wonder how to do specific redirection based on the scenario below?

When people open 开发者_如何转开发this url at browser http://www.test.com/gotogoogle it will redirect them to http://www.google.com.


You could use a RewriteMap in the IIS7 URL Rewrite module to achieve this..

http://learn.iis.net/page.aspx/469/using-rewrite-maps-in-url-rewrite-module/


You can achieve this with URL Rewrite module. The rule will be (content of web.config from website root folder):

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="Go To Google" stopProcessing="true">
                    <match url="^gotogoogle$" />
                    <action type="Redirect" url="http://www.google.com/" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

If you already have web,config, then add appropriate fragment only.

0

精彩评论

暂无评论...
验证码 换一张
取 消