当前位置: 首页 > 文章分享 > 建站技术 > ThinkPHP > ThinkPHP web.config如何实现301跳转

ThinkPHP web.config如何实现301跳转

2020-08-05浏览量:79发布:admin

<?xml version="1.0"?>
<configuration>
<system.webServer>
<rewrite>
 <rules>
                <rule name="301Redirect" stopProcessing="true">
                    <match url="(.*)" />
                    <conditions logicalGrouping="MatchAny">
                        <add input="{HTTP_HOST}" pattern="^fanga\.com$" />
                    </conditions>
                    <action type="Redirect" url="http://www.fanga.com/{R:0}" redirectType="Permanent" />
                </rule>
                 <rule name="OrgPage" stopProcessing="true">
                 <match url="^(.*)$" />
                 <conditions logicalGrouping="MatchAll">
                 <add input="{HTTP_HOST}" pattern="^(.*)$" />
                 <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                 <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                 </conditions>
                 <action type="Rewrite" url="index.php/{R:1}" />
</rule>
 </rules>        
 </rewrite>
 </system.webServer>
 </configuration>

上一篇:没有了
下一篇:没有了