103
如何设置301重定向

如要将example.com重定向到www.example.com,则配置web.config如下:

xml version="1.0" encoding="utf-8"?>




name="www" stopprocessing="true">
url=".*" />

input="{http_host}" pattern="^example\.com$" />

type="redirect" url="http://www.example.com/{r:0}" redirecttype="permanent" />