WebFaction
Community site: login faq

I am trying to run a codeigniter app but the following message is showing:

404 Page Not Found

The page you requested was not found.

asked 02 Apr '12, 15:03

Douglas Dias
1111
accept rate: 0%

I don't have a complete solution for this - just wanted to let you know that I answered your support ticket :)

(02 Apr '12, 18:20) seanf

In order to say something, more details are needed:
- did you replicate the standard Codeigniter directory structure or did you change it?
- do you use a .htaccess redirection or do you use standard CI uri's?
- did you edited the index, config and routes file? if yes, in particular, which is the routes succession?
- the 404 page is the one of the Webfaction server or the Codeigniter 404 error page?

(04 Apr '12, 14:52) robertotra

the Codeigniter 404 error page. $route['news/create'] = 'news/create'; $route['news/(:any)'] = 'news/view/$1'; $route['news'] = 'news'; $route['(:any)'] = 'pages/view/$1'; $route['default_controller'] = 'pages/view';

(10 Mar '14, 13:51) Muhammad Ham...

dear seanf! my code and route is class News extends CI_Controller{

        public function __construct()
        {
            parent::__construct();
            $this->load->model('news_model');
        }

        public function index()

        {

            $data['news']= $this->news_model->get_news();
            $data['title'] = 'News archive';

            $this->load->view('templates/header',$data);
            $this->load->view('news/index',$data);
            $this->load->view('templates/footer');
        }

        public function view($slug)
        {   
            //$data['news'] = $this->news_model->get_news($slug);
            $data['news_item']=$this->news_model->get_news($slug);

            if(empty($data['news_item']))
            {
                show_404();
            }
                $data['title']= $data['news_item']['title'];

                $this->load->view('templates/header',$data);
                $this->load->view('news/view',$data);
                $this->load->view('templates/footer');
        }

$route['news/create'] = 'news/create'; $route['news/(:any)'] = 'news/view/$1'; $route['news'] = 'news'; $route['(:any)'] = 'pages/view/$1'; $route['default_controller'] = 'pages/view'; // all records upload but not issue single slug related record

it is code igniter.

please guide

permanent link

answered 10 Mar '14, 13:18

Muhammad Ham...
1
accept rate: 0%

What is the problem that you're having?

(10 Mar '14, 19:54) seanf
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×108
×22
×8

question asked: 02 Apr '12, 15:03

question was seen: 17,645 times

last updated: 10 Mar '14, 19:54

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM