网站模板源码空间主机设计梦想站

您的当前位置:网站首页 » 本站公告 » 正文—产品服务相关-图片价格表-明细价格表-综合价格表——源码论坛

帮助:Thinkphp 在IIS7.5-8.5-11.0 上 web.config伪静态规则!

来源:本站 发表:2025-05-20 点击:20

 因提供的网站空间都是采用的windows系统,IIS版本分别为IIS7.5,IIS8.5,IIS10.0,因此Thinkphp自带的伪静态规则.htaccess是无法使用的,必须转换为web.config才行,下面是转换好的代码:

 
<?xml version="1.0" encoding="UTF-8"?>
 
<configuration>
 
    <system.webServer>
 
 <rewrite>
 
  <rules>
 
  <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>
 
将以上代码,保存到web.config文件内,上传到网站根目录,即可使用。如果您不会使用,可以联系在线客服协助。