隐藏 index.php

[ IIS ]

如果你的服务器环境支持ISAPI_Rewrite的话,可以配置httpd.ini文件,添加下面的内容:

  1. RewriteRule (.*)$ /index\.php\?s=$1 [I]

在IIS的高版本下面可以配置web.Config,在中间添加rewrite节点:

  1. <rewrite>
  2. <rules>
  3. <rule name="OrgPage" stopProcessing="true">
  4. <match url="^(.*)$" />
  5. <conditions logicalGrouping="MatchAll">
  6. <add input="{HTTP_HOST}" pattern="^(.*)$" />
  7. <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
  8. <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
  9. </conditions>
  10. <action type="Rewrite" url="index.php/{R:1}" />
  11. </rule>
  12. </rules>
  13. </rewrite>
posted @ 2017-02-13 15:50  #i小龙#  阅读(266)  评论(0编辑  收藏  举报