美文网首页
IIS8下省略index.php

IIS8下省略index.php

作者: 寒潭碎梦 | 来源:发表于2017-08-02 13:21 被阅读0次

在做PHP系统的时候,在win server 2012的iis下面使用会用到url重写,需要省略index.php,所以记录这个重写规则.将以下代码保存在web.config文件里并放在网站根目录,即可实现省略index.php

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <rewrite>
      <rules>
        <rule name="WPurls" enabled="true" stopProcessing="true">
          <match url="^(.*)$" />
          <conditions logicalGrouping="MatchAll">
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
          </conditions>
          <action type="Rewrite" url="index.php/{R:0}" />
        </rule>
      </rules>
    </rewrite>
  </system.webServer>
</configuration>

相关文章

  • IIS8下省略index.php

    在做PHP系统的时候,在win server 2012的iis下面使用会用到url重写,需要省略index.php...

  • laravel route localhost

    因为laravel默认入口文件为public/index.php,又因为index.php可以省略,当没有使用ap...

  • 更美的URLs

    为了让我们的URL省略掉index.php的同时,又让所有的请求指向index.php这个入口文件,这时候就要对我...

  • nginx+CI框架 404的问题

    在apache下访问index.php/welcome/index能够吧index.php后面的部分作为参数传递给...

  • windows2012下iis8+mysql+php的环境安装

    iis8安装步骤 1-单击宫格菜单的第一个“服务器管理器”; 22-在“快速启动(Q)”子菜单下,单击“2 添加角...

  • Phalcon Controllers下多目录设置

    ##Phalcon app\controllers\ 下多目录 该怎么设置? ·public/index.php ...

  • 版本控制

    SVN touch index.php 创建一个Index.php svn add index.php svm ...

  • IIS8伪静态

    根目录创建web.config文件 这样index.php就可以省去了,但是代码中的正则 ^(.*)$ 匹配了所有...

  • tp 在nginx下隐藏index.php

    参考文档https://www.cnblogs.com/wuheng1991/p/6962878.html

  • index.php

    小微oa 3.0 开发手册整理 index.php

网友评论

      本文标题:IIS8下省略index.php

      本文链接:https://www.haomeiwen.com/subject/fkwelxtx.html