IIS 7.5中的301永久重定向配置方法网上查了好几种方法,乱七八糟,下面贴出最简单的方法,当然这些需要你安装微软提供的rewrite模块。
修改web.config配置文件,上面这段是实现URL标准化有利于SEO的,下面那段就是临时添加个url进行跳转的方法,这个方法做淘宝客什么的,目标地址如果有变更,只需要在配置里简单修改一下既可,当然如果你url特多,你也可以安装一个短url系统,对于只有极个别跳转的,这样简单配置一下比较方便。
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="WWW Redirect" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{HTTP_HOST}" pattern="^win7soft.com$" />
</conditions>
<action type="Redirect" url="http://www.win7soft.com/{R:0}" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
</system.webServer>
<location path="share/win7_ultimate_key">
<system.webServer>
<httpRedirect enabled="true" destination="http://item.taobao.com/item.htm?id=12730969071" exactDestination="true" childOnly="true" httpResponseStatus="Permanent" />
</system.webServer>
</location>
</configuration>
