Cootel Kh
Cootel Kh

Reputation: 97

Why I go error_404.php errors in codeigniter when upload to hosting?

my website doesn't work when i upload to hosting but it is work in localhost. and when I try to access url it alwasy show me ERROR - 12-01-14 06:33:25 --> 404 Page Not Found: /index (log file) and I got errors.

Here is my hosting user name and password Access the Control Panel here:

and Router

$route['default_controller'] = 'page';
$route['cat/(:num)'] = 'cat/index/$1/$2/$3';
$route['detail/(:num)'] = 'detail/index/$1/$2';
$route['404_override'] = '';

In Controller file name:page Class name: Page.

<?php

Class Page extends Frontend_controller {

    public function __construct() {
        parent::__construct();

    }

    public function index() {

         $this->data['subview'] = 'page';
        $this->load->view('_main_layout', $this->data);
        }
?>

and .htaccess

# Set PHP Time Zone:
#SetEnv TZ America/New_York
<IfModule mod_rewrite.c>

#Option +FollowSymlinks
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond $1 !^(index\.php|pages|video|images|social|style|sliderengine|bar|robots\.text)

RewriteRule ^(.*)$ index.php?/$1 [QSA,L]

</IfModule>

I get only this messages Message: include(): Failed opening 'application/views/errorshtml/error_404.php' for inclusion (include_path='.;c:\php\pear')

How can I do now

Upvotes: 0

Views: 1674

Answers (1)

Chamath Nimantha
Chamath Nimantha

Reputation: 169

Most times this error is happening because of file naming problems. I think you are using a Linux hosting. So I also faced to the same problem and finally I found the solution we cannot use file names with UPPERCASE characters.

Example

If we have a controller called my_controller the file name is should be like this my_controller.php and don't use UPPERCASE characters like this My_Controller.php, myController.php for the file name.

Upvotes: 5

Related Questions