虚拟空间iis环境下如何隐藏index.phpphp
网上好多教程都是说要改iis环境什么的,但问题是,我只是虚拟空间啊,别人又不会帮你改iis什么的html
弄了一天,头都炸了,后来无心间看到一个帖子,配置web.config。瞬间就通透了web
就在tp5根目录下写了个config文件。ide
好了屁话很少说了,直接上代码url
本身建立一个web.config文件,代码以下xml
<?xml version="1.0"?>htm
<configuration>教程
<system.webServer>input
<rewrite>it
<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>