首先确认是的运行环境是否 iis,然后查看空间根目录下是否有 web.config文件,在文件里新增代码即可,如图:
<rewrite>
<rules>
<rule name="Imported Rule 1" enabled="true" 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>
转自:http://www.eyoucms.com/bbs/1828.html转载于:https://blog.51cto.com/13839324/2307673
IIS下配置URL重写
本文介绍如何在IIS环境下通过编辑web.config文件实现URL重写,详细展示了添加rewrite规则的具体代码,使请求能够被重定向到index.php,适用于需要进行路径映射的网站或应用。
812

被折叠的 条评论
为什么被折叠?



