iis下TP5的url重写

iis下TP5url重写

//测试数据:
//服务器版本IIS6.1
//应用程序语言:php
//框架:ThinkPHP5.0.*
//说明:以下代码来自iis的配置文件 web.config
//URL重写测试结果:成功。
//(有兴趣的朋友可以试试其它IIS版本是否也可以)

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="重写规则 1" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="index.php/{R:1}" appendQueryString="true" />
</rule>
</rules>
</rewrite>
</system.webServer>

<httpErrors errorMode="Detailed" />//显示详细错误信息
<directoryBrowse enabled="true" />//允许目录访问
</configuration>

猜你喜欢

转载自blog.csdn.net/qq_15941409/article/details/81335807
tp5
今日推荐