CI(4)隐藏URL里面的index.php过程总结
来源:互联网 发布:js舞蹈培训中心好不好 编辑:程序博客网 时间:2024/05/22 17:38
1、开启apache重定向功能:
2、项目的根目录(与index.php文件是同一级目录)下新建一个.htaccess文件,并写入如下内容:(1)要修改Apache 的配置文件,让Apache支持rewrite_module,修改过程如下:打开apache的配置文,conf/httpd.conf :LoadModule rewrite_module modules/mod_rewrite.so,把该行前的#去掉;(2)搜索 AllowOverride None 即 Options Indexes FollowSymLinks MultiViews下面那个,修改为 AllowOverride All (一般情况下是有两个,两个都要修改!)。
3、修改CI框架下的‘/application/config/config.php’配置文件:RewriteEngine onRewriteBase /ci/project //注意这里面的/ci/project/表示的是项目名称的(apache配置项目时的目录名称)RewriteCond $1 !^(index\.php|images|robots\.txt) //对于样式、JS、静态元素是不能rewrite的所以加这一句RewriteRule ^(.*)$ index.php/$1 [L]或:RewriteEngine onRewriteCond $1 !^(index\.php|images|robots\.txt)RewriteRule ^(.*)$ /ci/project/index.php/$1 [L]
$config['index_page'] = "index.php"; 修改为 $config['index_page'] = "";
实例:
初始访问“helloworld”页面链接:localhost/ci/project/index.php/helloworld
修改后访问链接:localhost/ci/project/helloworld
0 0
- CI(4)隐藏URL里面的index.php过程总结
- CI框架 .htaccess 隐藏url中index.php的解决
- ci的index.php隐藏
- ci 隐藏index.php
- CI框架 .htaccess 隐藏url在index.php解决方案
- CI框架 .htaccess 隐藏url中index.php的解决(转)
- CI如何隐藏index.php
- CI 3.0 隐藏index.php
- thinkphp 去掉URL 里面的index.php
- PHP CI(CodeIgniter) 如何去掉url中的index.php
- CodeIgniter(CI)去掉默认url中的index.php
- 去掉CodeIgniter(CI)默认url中的index.php
- 去掉CodeIgniter(CI)默认url中的index.php
- 去掉CodeIgniter(CI)默认url中的index.php
- 去掉CodeIgniter(CI)默认url中的index.php的步骤:
- ci框架&tp框架隐藏index.php
- Codeigniter(CI) 去掉 URL 中的 index.php
- 去掉CI默认url中的index.php
- 通俗理解ActiveMQ
- Centos7 下yum 命令安装MySQL
- Android注释模板大全 (eclipse 和android studio均可使用)
- Java的位运算符详解实例——与(&)、非(~)、或(|)、异或(^)
- 开发PHP Web微信支付所遇到的配置问题
- CI(4)隐藏URL里面的index.php过程总结
- sql drop 简单操作(Mysql)
- Android studio:URI is not registered 的解决办法
- Java 发送邮件 邮箱验证 (qq.com为例)
- maven项目用 run on server 运行报classNotFound错误,lib没有导入到tomcat中,解决方法:
- 密码学、信息安全、信息隐藏(论文)
- HCIE数通方向面试总结
- 类变量、成员变量、实例变量、局部变量、静态变量、全局变量 的解释。
- NOSQL(redis)与关系型DB区别