CodeIgniter如何去掉Index.php-apache服务器
来源:互联网 发布:ajaxfileupload php 编辑:程序博客网 时间:2024/05/17 01:46
CI默认的rewrite url中是必须加上一个index.php,这样看起来URL不是很美观,下面我就给大家分享一下如何去掉CodeIgniter中的index.php
打开你的WEB服务器的httpd.conf文件,以本地的XAMPP环境为例,点击面板上的“config”,然后选择“Apache(httpd.conf)”
找到LoadModule rewrite_module modules/mod_rewrite.so这行,把该行前的#去掉。保存该文件
进入到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]
保存.htaccess可以使用另存为的方式,然后文件类型选择“All Files”即可保存
最后到CI目录下的config文件夹下,在config.php文件中,将$config['index_page'] = "index.php"; 修改为 $config['index_page'] = ""; 最后重启Apache 服务器,再次访问,就不需要输入index.php了。
来源:百度经验 https://jingyan.baidu.com/album/2fb0ba4054cd5900f3ec5f52.html?picindex=1
阅读全文
0 0
- CodeIgniter如何去掉Index.php-apache服务器
- CodeIgniter 框架在Apache服务器下去掉index.php 总结
- CodeIgniter 去掉index.php
- CodeIgniter 去掉index.php
- IIS APACHE 下 codeigniter 去掉index.php方法
- PHP CI(CodeIgniter) 如何去掉url中的index.php
- linux 服务器 去掉 codeigniter 路径的index.php
- 如何去掉CI (codeigniter)url中的index.php
- 如何去掉CodeIgniter中URL里的index.php
- 解析如何去掉CodeIgniter URL中的index.php
- 解析如何去掉CodeIgniter URL中的index.php
- [PHP]去掉CodeIgniter URL中的index.php
- PHP CodeIgniter(CI)去掉 index.php
- CodeIgniter 的url中去掉index.php
- Codeigniter(CI) 去掉 URL 中的 index.php
- 去掉CodeIgniter URL中的index.php
- 去掉CodeIgniter URL中的index.php
- CodeIgniter框架去掉url中的index.php
- C语言读写BMP格式图片
- 文章标题
- 3048: [Usaco2013 Jan]Cow Lineup
- Canny边缘检测算法原理及其VC实现详解(一)
- 管理 Java 类路径 (Windows)
- CodeIgniter如何去掉Index.php-apache服务器
- 前端ie不兼容现在的主流js写法问题
- Java垃圾收集学习笔记
- 编码格式
- Struts2属性驱动与模型驱动
- MySQL Daemon failed to start. 无法启动
- 浅谈EABI和OABI
- 深度学习 激活函数
- HDU