tp5 配置.htaccess还是不能隐藏index.php时

tp5 配置.htaccess还是不能隐藏index.php时

搞得我头痛的事情 从昨天晚上8点到第二天凌晨5点

一直徘徊在.htaccess的配置上 百度里所有的答案也是说配置.htacess

知道我发现web.conf  

在csdn上终于有人说到他的配置了 同样的也可以隐藏index.php 晕


<handlers>里的代码是配置php版本的不用管了 

重要的是<rewrite>里的代码

<?xml version="1.0" encoding="UTF-8"?>

<configuration> <system.webServer>

<handlers> <remove name="PHP-7.0-7i24.com" />

<remove name="PHP-5.6-7i24.com" />

<remove name="PHP-5.5-7i24.com" />

<remove name="PHP-5.4-7i24.com" />

<remove name="PHP-5.3-7i24.com" />

<remove name="PHP-5.2-7i24.com" />

<add name="PHP-7.0-7i24.com" path="*.php" verb="*" modules="FastCgiModule" scriptProcessor="c:\php\7.0\php-cgi.exe" resourceType="Either" />

</handlers>


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

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

友情链接更多精彩内容