日期:2014-05-16  浏览次数:21546 次

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里写你的过滤规则