zoukankan      html  css  js  c++  java
  • IIS7以上版本去掉伪静态去掉index.php方法

    1,由于从iis7以上的版本httpd.ini文件已不会被解析,将以下的xml文件复制到web.config 的文件中,然后放到网站的根目录即可。

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

    2.apache下去掉index.php 的方法,新建一 .htaccess 文件,将以下代码复制进去放到网站的根目录即可。

    htaccess文件必须放到跟目录下

    这个文件里面加:
    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
    </IfModule>

    附参考:http://sjolzy.cn/ThinkPHP-remove-the-indexphp-url.html

  • 相关阅读:
    第一个SWT程序
    稀疏数组
    算法与数据结构
    《Java核心技术》学习笔记 第1-3章
    算术运算符
    5.11 rw zip file
    5.10 gob序列化
    5.9 piping between writer and reader
    5.7 io.MultiWriter(buf, f)
    5.7 读写 二进制数据
  • 原文地址:https://www.cnblogs.com/lixiuran/p/3404373.html
Copyright © 2011-2022 走看看