zoukankan      html  css  js  c++  java
  • IIS 8.5 伪静态去掉index.php thinkphp 3.2.2

    因为测试都是在win下开发的 win8.1企业版

    II8.5 首先安装  Thinkphp 3.2.2 

    URL Rewrite Module 2.0

    http://www.iis.net/downloads/microsoft/url-rewrite#additionalDownloads

    上面地址选择 合适的版本下载安装

    安装完成后 关闭IIS 在重新打开

    在你建立的网站根目录有 web.config 这个文件

    输入伪静态规则

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

    具体位置参考下我的

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
        <system.webServer>
            <defaultDocument>
                <files>
                    <add value="index.php" />
                </files>
    
            </defaultDocument>
             <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>

    然后访问以前带index.php/控制器/方法 的链接 去掉index.php看看

    这个index.php对于JS来说 很不好 用uploadify上传后台地址用U函数生成index.php就很不好  总出错

    其他的一到后台地址 有index.php总是出错 

    伪静态规则还是不懂 等先做出来慢慢研究下

  • 相关阅读:
    【转】IDEA2019.1.3版本破解
    Docker部署Vue
    Docker使用
    MySql触发器
    JVM 理论基础目录(待更新,系列完全写完后会统一整理好)
    JVM 5 JAVA 垃圾回收机制
    JVM 运行时数据区:程序计数器、Java 虚拟机栈和本地方法栈,方法区、堆以及直接内存
    JVM 整体流程介绍
    JVM 入门指南
    Linux 常用命令(根据自己的理解随时更新)
  • 原文地址:https://www.cnblogs.com/xxx91hx/p/4184826.html
Copyright © 2011-2022 走看看