CodeIgniter 如何去掉 Index.php
2024-10-16 13:08:41
步骤;
1.打开你的WEB服务器的httpd.conf文件.
2.找到LoadModule rewrite_module modules/mod_rewrite.so这行,把该行前的#去掉。保存该文件
3.
进入到CI根目录,新建.htaccess文件,输入
RewriteEngine on
RewriteCond $1 !^(index\.php|style|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
当然如果你的目录不是根目录,则要注意,比如我的URL为http://localhost/ci,则最后一行要改为RewriteRule ^(.*)$ /ci/index.php/$1 [L]
4.保存.htaccess可以使用另存为的方式,然后文件类型选择“All Files”即可保存
5.最后到CI目录下的config文件夹下,在config.php文件中,将$config['index_page'] = "index.php"; 修改为 $config['index_page'] = ""; 最后重启Apache 服务器,再次访问,就不需要输入index.php了。
最新文章
- 解决“Dynamic Web Module 3.0 requires Java 1.6 or newer.”错误
- Go收藏
- centos7 安装nginx和php5.6.25遇到 无法访问php页面 报错file not found 问题解决
- android-解决EditText的inputType为Password时, 字体不一致的问题
- Strom Topology执行分析:worker数,Bolt实例数,executor数,task数
- [HDU 4828] Grids
- python 连接oracle 数据库
- 14.10.1 InnoDB Disk I/O
- 《转》VC++多线程编程
- [翻译]初识SQL Server 2005 Reporting Services Part 1
- ubuntu环境下jdk安装及jenkins安装
- HDFS笔记——技术点汇总
- python经典书籍推荐:Python核心编程
- 深入理解SpringCloud之Eureka注册过程分析
- MFC函数—— CFrameWnd::OnCreateClient
- windows virus-search-kill-monitor
- Spark Streaming 例子
- UVALive7261(2015ACM/ICPC北京赛区现场赛A)
- 常见的浏览器兼容性问题与解决方案——CSS篇
- 解决flashfxp连接虚拟机报错 530 permission denied
热门文章
- OpenCV2.x自学笔记——Qt5.5.1打包exe
- ElasticSearch(5)-Mapping
- Delphi用ADOquery主从表例子(转总结)
- Leetcode016 3Sum Closest
- chapter 13_4 跟踪table的访问
- Mybatis批量更新数据
- Asp.Net MVC 在后台获取PartialView、View文件生成的字符串
- cookie机制和session机制的区别(面试题)
- javaWEB总结(2): load-on-startup节点
- 瑞游天翼客户端win7,win8,win10