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. CentOS7下安装ELK(nginx 、elasticsearch-5.1.1、logstash-5.1.1、kibana-5.1.1)

    nginx: #直接yum安装: [root@elk-node1 ~]# yum install nginx -y 官方文档:http://nginx.org/en/docs/http/ngx_htt ...

  2. CentOS 使用官方源yum安装最新nginx版本

    CentOS 使用官方源yum安装最新nginx版本 1.创建nginx.repo # vi /etc/yum.repos.d/nginx.repo 2.添加内容#如果是CentOS6,文件内容如下: ...

  3. HTML a标签链接 设置点击下载文件

    通常情况下,为文件添加链接后,用户可以通过点击链接,直接将文件下载到本地,如下载 excel 表格等 <a href="/user/test/xxxx.excel">点 ...

  4. 2019年计算机技术与软件专业技术资格(水平)考试安排v

    根据<关于2019年度专业技术人员资格考试计划及有关问题的通知>(人社厅发[2018]142号)要求,2019年度计算机技术与软件专业技术资格(水平)考试(以下简称计算机软件资格考试)安排 ...

  5. CSAGAN的几大重点 - 2

    1.生成器 1)MRU(SketchyGAN) 计算过程为: 与DCGAN[46]和ResNet生成架构的定性和定量比较可以在5.3节中找到.MRU块有两个输入:输入特征图xi和图像I,输出特征图yi ...

  6. Windows下启动、重启、停止nginx

    在Windows下操作nginx,需要打开cmd 进入到nginx的安装目录下 1.启动nginx: start nginx 或 nginx.exe 2.停止nginx(stop是快速停止nginx, ...

  7. vbscript--FileSystemObject详解

    https://blog.csdn.net/superbirds/article/details/6762748 FSO是FileSystemObject 或 Scripting.FileSystem ...

  8. windows下tomcat日志的坑

    最近在调试工程,想着在windows下多开窗口操作方便,结果发现日志竟然不全,百思不得其解.最后发现竟然是部署的坑. 之前的部署都是在bin目录下运行service.bat安装服务后了事,启停都通过t ...

  9. Difference between java.lang.RuntimeException and java.lang.Exception

    In Java, there are two types of exceptions: checked exceptions and un-checked exceptions. A checked ...

  10. 何为JavaScript原型?读完你就明白了

    熟悉软件开发的朋友都知道,原型是产品或数据系统的一个基本的实用模型,通常为示范目的或开发程序的部份结构.原型的重要性不言而喻,接下来我就会为你讲解关于JavaScript中的原型概念.原型对象释义每一 ...