默认 CI 框架显示地址是 http://localhost/ci/index.php/test/
去掉index.php这样会更好些。
1.修改Http.conf的
LoadModule rewrite_module modules/mod_rewrite.so
去掉注释
2.ci根目录增加.htaccess文件
[plain] view plaincopy
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /ci
#Removes access to the system folder by users.
#Additionally this will allow you to create a System.php controller,
#previously this would not have been possible.
#'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
#When your application folder isn't in the system folder
#This snippet prevents user access to the application folder
#Submitted by: Fabdrol
#Rename 'application' to your applications folder name.
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
# If we don't have mod_rewrite installed, all 404's
# can be sent to index.php, and everything works as normal.
# Submitted by: ElliotHaughin
ErrorDocument 404 /index.php
</IfModule>
.htaccess文件内容
注意winodws下不好直接增加 要有技巧的 可以参看我另一篇文章
3.刷新地址栏
http://localhost/ci/test/ 已经可以看了
转:http://blog.csdn.net/21aspnet/article/details/6602610
分享到:
相关推荐
ci 隐藏 index.php 以及 设置路由
基于ci框架的index基于ci框架的index基于ci框架的index基于ci框架的index基于ci框架的index
这是通过学习了后盾网16个视频教程之后,进行的总结。另外还有两个前期框架搭配的总结。下面会列出视频的名称。其实CI框架很简单,看过视频之后就...16. CI框架学习-实例操作隐藏index.php、伪静态、缓存、开启生产模式
CI框架图片压缩处理类,文件名不用改,直接放到libraries 目录,直接用就可以了。补充一下,在此PHP文件最上方,加上 ini_set ("memory_limit","-1"); //直接取消PHP的内存限制 这句代码,可以防止大图片压缩超时...
ci框架
CI框架的mongo_db数据库扩展链接文件,有了它,CI框架链接mongo_db不在烦恼!
PHP开发教程之CI框架. CodeIgniter
C#清理IE地址栏记录.txtC#清理IE地址栏记录.txtC#清理IE地址栏记录.txt
PHP CI框架2.0的测试版.与之前的版本有些不一样,比如,脚手架已经被删除(可惜).文件结构也有一些变化。
用CI框架制作的OA系统,学习一下CI框架,请各位多多指教!初次学习上传,供大家学习
C# 清理 IE 地址栏记录.txtC# 清理 IE 地址栏记录.txt
ci框架的config.php配置文件 很详细 很具体
本例主要实现在CI框架中像ThinkPHP一样的二级域名解析方式 1. ci_url_rewirte.php 为实现的代码 可将其插入到system/URI.php 即框架URI类的相应地方 2. URI.php 为我实验版本(Version 1.0)的URI类,其他版本应用...
PHP CI框架修改功能 代码详解
ci 的帮助文档 和 ci 的基础讲解 ci是敏捷的PHP开发框架 有需要的同学可以看下
php的json和数组相互转换,ci框架遇到的一些问题总结,以及图片上传的一些功能
CI框架快速开发平PHP应用,快速学习ci框架。
教程名称:兄弟连最新php视频教程CI框架(19集)课程目录:【】兄弟连php视频教程CI框架-大纲【】兄弟连php视频教程CI框架01~04【】兄弟连php视频教程CI框架05~08【】兄弟连php视频教程CI框架09~12【】兄弟连php视频...
php CI codeigniter此框架适合各种网站,简单易懂,手册比较通俗易懂适合新老手
基于PHP CI 框架开发的RBAC权限系统,有简单的新闻管理、操作日志、数据字典等模块,数据库在压缩包中ci.sql,本机访问地址http://localhost/index.php/adminman