【发布时间】:2015-02-08 13:47:25
【问题描述】:
我是 web 开发新手,所以这个问题可能很简单。
我已安装并运行 xampp,并且正在使用 netbeans 最新版本。
我目前正在尝试学习一个需要我制作几个控制器的教程,但我可以成功加载的唯一页面是 index.php。
我在 application/controllers 文件夹中创建了一个新控制器:
<?php
class Blog extends CI_Controller {
public function index()
{
echo 'Say something';
}
}
?>
并尝试通过
访问它http://localhost/Something/Blog
但我得到一个错误:
Object not found!
The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.
If you think this is a server error, please contact the webmaster.
Error 404
localhost
Apache/2.4.10 (Win32) OpenSSL/1.0.1i PHP/5.6.3
附言
http://localhost/Something is loading fine.
我已经编辑了 .htaccess 文件:
RewriteEngine on
RewriteCond %(REQUEST_FILENAME) !-f
RewriteCond %(REQUEST_FILENAME) !-d
RewriteRule ." index.php/$0 [PT,L]
我已经在谷歌上搜索了 3 个小时的解决方案,如果有任何帮助,我将不胜感激 :)
【问题讨论】:
标签: php codeigniter controller