ローカルホストにblog.phpという名前のコントローラーがあります。アクセスするには、アドレスバーにhttp://localhost/ci/index.php/blogと入力します。チュートリアルではHello Worldが表示されると書いてありましたが、表示されたのはblog.phpコードと404 Page Not Foundを含むページです。
これがコードです。
*<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Blog extends CI_Controller {
/**
* Index Page for this controller.
*
* Maps to the following URL
* http://example.com/index.php/blog
* - or -
* http://example.com/index.php/blog/index
* - or -
* So any other public methods not prefixed with an underscore will
* map to /index.php/blog/<method_name>
* @see http://codeigniter.com/user_guide/general/urls.html
*/
public function index()
{
echo "Hello World";
}
}
/* End of file Blog.php */
/* Location: ./application/controllers/blog.php */*
誰でも何が問題なのか教えてください。