web.config可以设立页面跳转吗

web.config可以设置页面跳转吗?

环境: windows2008+iis7.0

我现在有几个页面也想在访问的时候做一下跳转,跳到首页

如:

www.xx.com/oo.html

www.xx.com/a/bb.html

访问他们的时候自动跳转到www.xx.com

需要怎么弄?




IIS里面可以配置




在Global里面写

使用

System.Web.HttpContext.Current.RewritePath

方法即可




<?xml version=”1.0″ encoding=”UTF-8″?>

<configuration>

    <location path=”index.html”>

        <system.webServer>

            <httpRedirect enabled=”true” destination=”http://www.xxoo.com/” exactDestination=”true” httpResponseStatus=”Permanent” />

        </system.webServer>

    </location>

</configuration>

 <location path=”index.html”> 指定文件名

or

搞个*.ashx handler里写你的过滤规则

web.config可以设立页面跳转吗

相关文章:

你感兴趣的文章:

标签云: