帮助与文档

7

如何设置301重定向

如要将a.com重定向到www.a.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="^a\.com$" />
                    </conditions>
                    <action type="Redirect" url="http://www.a.com/{R:0}" redirectType="Permanent" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer> 
</configuration>


17000000000
17000000000 17000000000
返回顶部
返回顶部 返回顶部