您的位置:首页 > 编程语言 > PHP开发

Win7系统IIS7+ThinkPHP如何使用 REWRITE模式

2017-11-27 03:00 141 查看
REWRITE模式(PATHINFO模式基础上隐藏index.php)

新建一个 web.config (UTF-8)文件,打开该文件,写下面的代码

<?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>
</configuration>
保存,到此就可以使用 隐藏index.php的模式了
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  thinkphp iis iis7.0
相关文章推荐