虚拟主机如何设置301重定向 |
如要将10isp.com重定向到www.10isp.com,则配置web.config如下: <?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="www" stopProcessing="true"> <match url=".*" /> <conditions> <add input="{HTTP_HOST}" pattern="^10isp\.com$" /> </conditions> <action type="Redirect" url="http://www.10isp.com/{R:0}" redirectType="Permanent" /> </rule> </rules> </rewrite> </system.webServer> </configuration> |