doucuoyan0426 2013-07-13 19:37
浏览 100

CodeIgniter“找不到您请求的页面。”错误?

I'm having a problem with CodeIgniter. I've checked every possible solution on the internet and seems like nothing helps in my case. I'm not a big pro and it's my first time using CodeIgniter so don't be harsh with me.

routes.php:

$route['default_controller'] = "page";
$route['404_override'] = '';

$route['(:num)'] = "page/index/$1";

page.php:

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Page extends CI_Controller {

    public function index($id=null) {

        $this->load->model('Image','',TRUE);
        $this->load->model('Banner','',TRUE);
        $image = $this->Image->getImageById($id);
        if (empty($image)) {
            show_404();
        }
        //db table `banner` always have three rows
        $banners=$this->Banner->getBanners();
        $data=array();
        $data['image']=$image;
        $data['banner']=$banners;
        $this->load->view('page_index', $data);
    }
}
  • 写回答

7条回答 默认 最新

  • doudou2121 2013-07-13 21:01
    关注

    This doesn't sound like a Codeigniter error. It could be your webserver configuration. Do you have a webserver and php server setup and configured on your machine? Have you configured an .htaccess file to replace "index.php"?

    评论

报告相同问题?

悬赏问题

  • ¥15 mmocr的训练错误,结果全为0
  • ¥15 python的qt5界面
  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀