1.需要apache打开rewrite_module,然后修改httpd.conf的AllowOverride none 为AllowOverride All(里面,不同的环境目录不同)

2.在CI的目录下面创建.htaccess文件,加入如下内容:

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

3.修改config.php的内容:$config['index_page'] = 'index.php';替换为$config['index_page'] = '';

CI隐藏入口文件index.php的更多相关文章

  1. CI 框架怎么去掉隐藏入口文件 index.php

    当我重新接触一个框架的时候首先肯定要去掉入口文件,也就是index.php 这个东西在url上很不漂亮,而且每次我访问我的网站的时候都要打进去url里面.这样告诉一个去掉 CI框架里面入口文件的方法, ...

  2. ThinkPHP5.X PHP5.6.27-nts + Apache 通过 URL 重写来隐藏入口文件 index.php

    我们先来看看官方手册给出关于「URL 重写」的参考: 可以通过 URL 重写隐藏应用的入口文件 index.php ,Apache 的配置参考: 1.http.conf 配置文件加载 mod_rewr ...

  3. Apache 隐藏入口文件 index.php

    新建 .htaccess文件至站点目录下,并写入如下代码: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQ ...

  4. 【apache】phpstudy中apache 隐藏入口文件index.php (解决no input file specified错误)

    步骤: 下面我说下 apache 下 ,如何 去掉URL 里面的 index.php 例如: 你原来的路径是: localhost/index.php/Index/index改变后的路径是: loca ...

  5. nginx隐藏入口文件index.php

    网站的访问url可能是这样http://www.xxx.com/index.php/home/index/index 这种有点不美观,我们想达到如下效果http://www.xxx.com/home/ ...

  6. TP5 隐藏入口文件 index.php

    找到public下的.htaccess <IfModule mod_rewrite.c> Options +FollowSymlinks -Multiviews RewriteEngine ...

  7. niginx隐藏入口文件index.php

    location / { if (!-e $request_filename) { rewrite ^/(.*)$ /index.php/$ last; break; } }

  8. Nginx配置 隐藏入口文件index.php

    Nginx配置文件里放入这段代码 server { location / { index index.php index.html index.htm l.php; autoindex on; if ...

  9. Nginx如何来配置隐藏入口文件index.php(代码)

    Nginx配置文件里放入这段代码 server { location / { index index.php index.html index.htm l.php; autoindex on; if ...

随机推荐

  1. Linux下如何测试网速

    本文链接:https://blog.csdn.net/Beyond_F4/article/details/80497118在Linux下如何测量下载和上传的速度? 这里用到一个Python工具spee ...

  2. videojs使用技巧

    1 初始化 Video.js初始化有两种方式. 1.1 标签方式 一种是在<video>标签里面加上class="video-js"和data-setup='{}'属性 ...

  3. Python logging模块日志存储位置踩坑

    问题描述 项目过程中写了一个小模块,设计到了日志存储的问题,结果发现了个小问题. 代码结构如下: db.py run.py 其中db.py是操作数据库抽象出来的一个类,run.py是业务逻辑代码.两个 ...

  4. 登陆服务器提示“You need to run "nvm install N/A" to install it before using it.”

    一.登陆服务器提示“You need to run "nvm install N/A" to install it before using it.” 二.执行命令: nvm ls ...

  5. JS 从整数里 随机选一个

    比如:现有数字随机一个 num = 3)) // 现有数随机一个 randomNum 的值只会是 0 1 2 3 里的随机一个 如果想要从数组随机一个下标index 就不要+1 如: parseInt ...

  6. Sword 哈希表

    哈希表 哈希表是一种典型的以空间换取时间的数据结构,在没有冲突的情况下,对任意元素的插入.索引.删除的时间复杂度都是O().这样优秀的时间复杂度是通过将元素的key值以hash方法f映射到哈希表中的某 ...

  7. Eclipse 修改(重定向)SVN地址

    由于SVN服务器IP变了,需要重定向SVN的路径 1.点击右上角1位置的按钮,然后选择需要打开的窗口(SVN资源库) 2.右击SVN资源库中的项目,选择重定向,然后修改新的URL即可 1. 进入本地s ...

  8. window 安装使用npm

    [安装步骤] 一.安装node.js 1.前往node.js官网下载并安装工具,这里安装路径选到D盘,D:\nodejs 安装完毕后在命令行输入以下命令测试是否安装成功,正确会出现版本号 npm -v ...

  9. dotnet core swagger filter 隐藏接口和显示枚举描述

    dotnet core 2.2开发项目中,常会使用Swagger UI来生成在线Api文档. 某些接口不想放到Swagger中可以这样写Filter: /// <summary> /// ...

  10. windows mysql手动添加my.ini 服务启动不了

    [mysqld] character-set-server=utf8 #绑定IPv4和3306端口 bind-address=0.0.0.0 port= default_storage_engine= ...