PHP CI(CodeIgniter) 如何去掉url中的index.php
2014-10-09 14:18
851 查看
1、打开Apache配置文件httpd.conf,找到
搜索AllowOverride,将相应Directory下的AllowOverride设置为All
[/code]
2、在CI的根目录下,建立.htaccess文件,文件内容如下
3、打开文件application/config/config.php,$config['index_page'] = "index.php";改为$config['index_page'] = "";
4、重启Apache
#LoadModule rewrite_module modules/mod_rewrite.so去掉前面的#
搜索AllowOverride,将相应Directory下的AllowOverride设置为All
[code]AllowOverride All |
2、在CI的根目录下,建立.htaccess文件,文件内容如下
RewriteEngine On RewriteCond %{REQUEST_URI} ^system.* RewriteRule ^(.*)$ /index.php?/$1 [L] RewriteCond %{REQUEST_URI} ^application.* RewriteRule ^(.*)$ /index.php?/$1 [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?/$1 [L]
3、打开文件application/config/config.php,$config['index_page'] = "index.php";改为$config['index_page'] = "";
$config['index_page'] = "";
4、重启Apache
相关文章推荐
- 如何去掉CI (codeigniter)url中的index.php
- 去掉CodeIgniter(CI)默认url中的index.php的步骤:
- 解析如何去掉CodeIgniter URL中的index.php
- CodeIgniter(CI)去掉默认url中的index.php
- Codeigniter(CI) 去掉 URL 中的 index.php
- 如何去掉CodeIgniter中URL里的index.php
- 去掉CodeIgniter(CI)默认url中的index.php的步骤(完整版)
- 如何去掉CodeIgniter URL中的index.php
- 解析如何去掉CodeIgniter URL中的index.php
- 如何去掉CodeIgniter URL中的index.php
- 去掉CodeIgniter(CI)默认url中的index.php
- 解析如何去掉CodeIgniter URL中的index.php
- 去掉CodeIgniter(CI)默认url中的index.php
- 去掉CodeIgniter(CI)默认url中的index.php
- CodeIgniter 去掉 URL 中的 index.php
- 去掉CodeIgniter URL中的index.php
- 如何去除codeIgniter开发的网站url里面的index.php字符串
- 如何去掉Magento默认URL中的index.php
- 去掉CodeIgniter URL中的index.php
- 去掉CodeIgniter URL中的index.php