CI框架去掉index.php以及解决No input file specified问题
来源:互联网 发布:win10 适用于linux 编辑:程序博客网 时间:2024/06/05 22:48
以下问题都容易解决,在此简述
1,打开apache的httpd.conf,开启rewrite_module,并且将AllowOverride None改为AllowOverride None。
2,在项目中,和index.php以及system文件夹同级的目录中,新建.htaccess文件,并写入一下代码
<IfModule mod_rewrite.c>RewriteEngine OnRewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule ^(.*)$ index.php/$1 [L]</IfModule>
这时,如果在浏览器访问首页,比如项目名为citest,当输入的url为
http://localhost/citest/Index/index时,会出现
No input file specified.
此时,只要将上述代码第四行中的
RewriteRule ^(.*)$ index.php/$1 [L]修改为
RewriteRule ^(.*)$ index.php?/$1 [L]即可,即在index.php与/之间添加一个?,这样就能够正常访问了。
不过在使用辅助函数site_url()和base_url()时,两个还是不太一样,
使用site_url时的路径为 http://localhost/citest/index.php
使用base_rul时的路径为 http://localhost/citest/
如果要去掉site_url中的路径,则在config.php中,将
$config['index_page'] = 'index.php';修改为
$config['index_page'] = '';即可
这样无论是site_url还是base_url的路径都为http://localhost/citest/
阅读全文
0 0
- CI框架去掉index.php以及解决No input file specified问题
- CI框架出现 No input file specified.
- CI框架出现 No input file specified.
- CI框架出现 No input file specified.
- 解决NGINX PHP "No input file specified"
- Windows下 NGINX PHP 以及 "No input file specified"
- Windows下 NGINX PHP 以及 "No input file specified"
- 解决NGINX PHP "No input file specified"
- 解决nginx服务器访问不存在的php页面显示No input file specified.问题
- 解决PHP5.6版本“No input file specified”的问题
- 关于php的( No input file specified. )问题
- 去掉 CI 框架中的 index.php
- CI框架路由去掉index.php
- no input file specified解决道路
- tp5 重定向缺少index.php报错(No input file specified)
- TP5 --我知道 重定向缺少index.php报错(No input file specified)
- tp5 重定向缺少index.php报错(No input file specified)
- ci 框架 index.php以及 js css 路径问题
- 免费分享: MySQL零基础入门教程!
- 基于netty的rpc框架
- SpringMVC 学习之JSTL函数
- 归并排序
- Android开发学习(8)SQLite
- CI框架去掉index.php以及解决No input file specified问题
- AdaBoost算法
- Word转换PDF:pdf虚拟打印机怎么用操作技巧详解
- 一名Android开发者的微信小程序填坑之路
- 微信小程序movable-view移动图片和双指缩放
- WordPress文章分页wp_link_pages()函数详解
- 联合排序
- Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node 解决办法
- HDU_6105 Gameia 【博弈】