tp5在IIS(winServer2012)服务器环境中隐藏index.php文件

  1. 下载并安装重写模块,地址:https://www.iis.net/downloads/microsoft/url-rewrite#additionalDownloads

2.随便设置一个规则,就会在你给该网站配置的物理路径下新建一个web.config文件


3.将下列文件中的内容替换掉web.config文件中的<rewrite></rewrite>标签内容

<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>


猜你喜欢

转载自blog.csdn.net/jiangxudong1085/article/details/80859838