CI框架路由去掉index.php
来源:互联网 发布:知乎 宋茜 编辑:程序博客网 时间:2024/05/16 17:27
apache去掉index.php
1.编辑conf/httpd.conf配置文件
#LoadModule rewrite_module modules/mod_rewrite.so 把该行前的#去掉
同时对应Directory下要配置 AllowOverride All
2.在 CI 根目录下(即在index.php,system的同级目录下)新建立一个配置文件,命名为: .htaccess 内容如下:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|robots\.txt)
RewriteRule ^(.*)$ index.php/$1
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(application|modules|plugins|system|themes) index.php/$1 [L]
3.把system/application/config/config.php 中$config['index_page'] = "index.php";改为$config['index_page'] = "";
4.重启apache
nginx去掉index.php
1.编辑nginx.conf文件
vi /usr/local/xxxxx/nginx/conf/nginx.conf
#nginx去掉index.php
location / {
rewrite ^/$ /index.php last;
#防止某些文件夹被直接访问
rewrite ^/(?!index\.php|robots\.txt|uploadedImages|resource|images|js|css|styles|static)(.*)$ /index.php/$1 last;
}
2.config/config.php下配置$config['index_page'] = '';
3..重启nginx
- CI框架路由去掉index.php
- 去掉 CI 框架中的 index.php
- CI去掉index.php
- CI去掉index.php
- CI去掉index.php
- CI去掉index.php
- 去掉php框架CI默认url中的index.php
- 去掉php框架CI默认url中的index.php
- PHP CodeIgniter(CI)框架中去掉 index.php方法
- php ci 去掉index.php
- CI框架去掉URl中的index.php部分
- 更改CI框架默认访问路径及去掉index.php
- PHP CodeIgniter(CI)去掉 index.php
- CI框架去除index.php
- CI去掉网址中的index.php
- Codeigniter(CI) 去掉 URL 中的 index.php
- CI中如何去掉index.php
- 去掉CI默认url中的index.php
- 多核系统中温度隐蔽通道的带宽优化
- 调用 GetProcAddress 失败,在 ISAPI 筛选器 "C:\Windows\MicrosoftNET\Framework\v4030319\
- Photoshop中27种图层混合模式原理图文详解
- Android简单、高性能的高斯模糊(毛玻璃)效果(附源码)
- hashmap原理
- CI框架路由去掉index.php
- Fiddler工作原理、使用场景
- [学习笔记]kd-tree
- 安卓icon图标大小标准,以及mdpi等对应放置的图片大小
- thinkphp 3.2预防sql注入、对查询的sql过滤
- Gilde 用法缓冲
- mysql死锁问题分析
- Android App应用程序实现自动更新
- 开发中用到的有用的网址