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总是出错

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

时间: 2024-08-06 07:59:16

IIS 8.5 伪静态去掉index.php thinkphp 3.2.2的相关文章

Thinkphp中去掉index.php

原文地址:http://www.thinkphp.cn/topic/30538.html 例如你的原路径是 http://localhost/test/index.php/index/add那么现在的地址是 http://localhost/test/index/add如何去掉index.php呢? 1.httpd.conf配置文件中加载了mod_rewrite.so模块 //在APACHE里面去配置 #LoadModule rewrite_module modules/mod_rewrite.

php CI 实战教程:如何去掉index.php目录

Windows下自由创建.htaccess文件的N种方法 .htaccess是apache的访问控制文件,apache中httpd.conf的选项配合此文件,完美实现了目录.站点的访问控制,当然最多的还是rewrite功能,即URL重写,PHP中实现伪静态的一个重要途径,也是被公认为SEO中搜索引擎友好的极为有效的一个手段.尽管前些天的黑屏风波闹的沸沸扬扬,但依本人拙见,windows用户并无任何减少.现在的一个实际问题就是windows不允许重命名时.的前面没有字符,它认为这样的文件名是不合法

***CodeIgnite/CI 去掉 index.php的 配置

CI有效删除URL中的index.php 参考: http://codeigniter.org.cn/forums/thread-15444-1-1.html 读CI的使用手册的话,关于如何有效删除URL中index.php以使URL看起来更友好美观的问题,可能是你面对的第一个较为复杂的问题!本贴不是原创,而是一个各种意见的综合!但本帖提出的解决方案可以有效解决Apache和IIS两种环境下的配置问题,同时也可以有效,避免部分虚拟LINUX虚拟主机上可能出现的no input file spec

dedecms建的网站如何去掉/index.html

DEDECMS建立的网站,www.abc.com/index.html和www.abc.com两个都可以访问,而且两个页面都是一样的,这样就会造成重复页面,对搜索引擎不友好,那么怎么去掉index.html只显示主域名呢. 修改方法是,打开网站根目录的index.php,将代码修改为下面的就可以 <?php if(!file_exists(dirname(__FILE__).'/data/common.inc.php')) {      header('Location:install/inde

lnmp 设置ci pathinfo和去掉index.php

LNMP上各个版本pathinfo各个版本的设置基本一样: lnmp v1.1上,修改对应虚拟主机的配置文件去掉#include pathinfo.conf前面的#,把try_files $uri =404; 前面加上# 注释掉. 1.2,1.3上,修改对应虚拟主机的配置文件将include enable-php.conf;替换为include enable-php-pathinfo.conf; 修改pathinfo需要重启nginx生效. 去掉 index.php location / {  

CI路径中如何去掉index.php

apache去掉index.php 1.编辑conf/httpd.conf配置文件 #LoadModule rewrite_module modules/mod_rewrite.so 把该行前的#去掉 同时对应Directory下要配置 AllowOverride All 2.在 CI 根目录下(即在index.php,system的同级目录下)新建立一个配置文件,命名为: .htaccess 内容如下: RewriteEngine On RewriteCond %{REQUEST_FILENA

CodeIgniter 框架在Apache服务器下去掉index.php 总结

最近一段时间一直研究CI框架,但是对CI框架的跳转链接一直需要加index.php前缀,经过CI论坛的各种解决方案,最后总结记录一下自己实际操作去掉index.php的过程. 1.要修改Apache 的配置文件,让Apache支持rewrite_module,修改过程如下:打开apache的配置文,conf/httpd.conf :LoadModule rewrite_module modules/mod_rewrite.so,把该行前的#去掉. 2.搜索 AllowOverride None

thinkphp去掉index.php

通常的URL里面含有index.php,为了达到更好的SEO效果可能需要去掉URL里面的index.php ,通过URL重写的方式可以达到这种效果,通常需要服务器开启URL_REWRITE模块才能支持.下面是Apache的配置过程,可以参考下:1.httpd.conf配置文件中加载了mod_rewrite.so模块2.AllowOverride None 将None改为 All3.确保URL_MODEL设置为24.把下面的内容保存为.htaccess文件放到入口文件的同级目录下 <IfModul

Thinkphp --- 去掉index.php

这里我使用的面板是宝塔,操作的 apche: 具体的配置可以参考这里: https://www.cnblogs.com/fangziffff123/p/7588782.html 首先是:Thinkphp的配置:Common/Conf的配置: /* 配置伪静态路由 */ 'URL_MODEL'=>'2', 'URL_ROUTER_ON' =>true, 接下来就是服务器上,对具体网站的 .htaccess 的配置: <IfModule mod_rewrite.c> Options +