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>