如何设置301重定向 |
如要将zzyun.com重定向到www.zzyun.com,则配置web.config如下: 1. <?xml version="1.0" encoding="UTF-8"?> 2. <configuration> 3. <system.webServer> 4. <rewrite> 5. <rules> 6. <rule name="www" stopProcessing="true"> 7. <match url=".*" /> 8. <conditions> 9. <add input="{HTTP_HOST}" pattern="^zzyun\.com$" /> 10. </conditions> 11. <action type="Redirect" url="http://www.zzyun.com/{R:0}" redirectType="Permanent" /> 12. </rule> 13. </rules> 14. </rewrite> 15. </system.webServer> 16. </configuration>
|