IIS下让php支持path_info伪静态的办法

作者在 2018-01-03 16:26:10 发布以下内容

在网站根目录建一个文件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>




当前前提是iis已经支持url rewrite

Windows | 阅读 3590 次
文章评论,共0条
游客请输入验证码
浏览2781252次
文章归档