thinkphp6 IIS伪静态规则设置

润凌小石头 阅读:526 2021-06-13 10:28:18 评论:0

将以下代码另存为web.config(文件名,后缀为config),上传到网站根目录中,即可生效。


image.png


<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
<rewrite>
 <rules>
 <rule name="OrgPage" stopProcessing="true">
 <match url="(?!/static)(.*)$" ignoreCase="false" />  <!-- 伪静态规则排除目录,一般为图片或静态素材。 -->
 <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>


声明

1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,请转载时务必注明文章作者和来源,不尊重原创的行为我们将追究责任;3.作者投稿可能会经我们编辑修改或补充。

发表评论
搜索
«    2025年8月    »
123
45678910
11121314151617
18192021222324
25262728293031
文章归档
关注我们

扫一扫关注我们,了解最新精彩内容

快捷导航返回顶部
润凌网络
在线留言
联系电话