虚拟空间iis环境下如何隐藏index.php

来源:互联网 发布:淘宝旺旺客服 编辑:程序博客网 时间:2024/05/17 18:01

虚拟空间iis环境下如何隐藏index.php

网上好多教程都是说要改iis环境什么的,但问题是,我只是虚拟空间啊,别人又不会帮你改iis什么的

弄了一天,头都炸了,后来无意间看到一个帖子,配置web.config。瞬间就通透了

就在tp5根目录下写了个config文件。


好了屁话不多说了,直接上代码

自己创建一个web.config文件,代码如下

<?xml version="1.0"?>

<configuration>

<system.webServer>

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


转自:大雄博客

0 0
原创粉丝点击