ci url怎么去掉index.php

藏色散人
发布: 2023-03-09 18:46:01
原创
1648 人浏览过

ci url去掉index.php的方法:首先修改配置文件;然后搜索htaccess将AllowOverride None改为“AllowOverride All”;最后建立“.htaccess”文件即可。

ci url怎么去掉index.php

本文操作环境:windows7系统、CodeIgniter3.0版,DELL G3电脑

去掉index.php:

首先修改配置文件, $config['index_page'] = ' '; 设置空  

然后修改Apache,搜索 htaccess  将 AllowOverride None 改为  AllowOverride All

搜索 rewrite_module modules/mod_rewrite.so  打开去掉#

在CI的根目录下,在system的同级目录下,建立.htaccess文件(创建.htaccess 用Notepad++),写入如下内容: 

RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /codeIgniter/index.php/$1 [L]

我的项目地址是 http://localhost/codeIgniter/index.php/user

重启Apache直接访问  http://localhost/codeIgniter/user  

推荐:《PHP视频教程

以上是ci url怎么去掉index.php的详细内容。更多信息请关注PHP中文网其他相关文章!

相关标签:
来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责声明 Sitemap
PHP中文网:公益在线PHP培训,帮助PHP学习者快速成长!