0
votes

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:

  • https://cp.supremecenter300.com
  • Client ID: 142606
  • Login: hengsopheak
  • Password: 2142885

    defined('BASEPATH') OR exit('No direct script access allowed');

    function __autoload($classname) { if (strpos($classname, 'CI_') !== 0) { $file = APPPATH . 'libraries/' . $classname . '.php'; if (file_exists($file)) { @include_once($file); } } }

    $config['base_url'] = '';

    $config['index_page'] = '';

    $config['uri_protocol'] = 'PATH_INFO';

    $config['url_suffix'] = '';

    $config['language'] = 'english';

    $config['charset'] = 'UTF-8';

    $config['enable_hooks'] = FALSE;

    $config['subclass_prefix'] = 'MY_';

    $config['composer_autoload'] = FALSE;

    $config['permitted_uri_chars'] = 'a-z 0-9~%.:_-';

    $config['allow_get_array'] = TRUE; $config['enable_query_strings'] = FALSE; $config['controller_trigger'] = 'c'; $config['function_trigger'] = 'm'; $config['directory_trigger'] = 'd'; // experimental not currently in use

    $config['log_threshold'] = 4;

    $config['log_path'] = '';

    $config['log_file_extension'] = 'php';

    $config['log_date_format'] = 'm-d-y H:i:s';

    $config['error_views_path'] = 'application/views/errors';

    $config['cache_path'] = '';

    $config['encryption_key'] = 'sdfasdfasdfasdfadf';

    $config['sess_driver'] = 'cookie'; $config['sess_valid_drivers'] = array(); $config['sess_cookie_name'] = 'ci_session'; $config['sess_expiration'] = 7720; $config['sess_expire_on_close'] = FALSE; $config['sess_encrypt_cookie'] = TRUE; $config['sess_use_database'] = TRUE; $config['sess_table_name'] = 'ci_sessions'; $config['sess_match_ip'] = TRUE; $config['sess_match_useragent'] = TRUE; $config['sess_time_to_update'] = 300;

    $config['cookie_prefix'] = ''; $config['cookie_domain'] = 'vtrashop.com/'; $config['cookie_path'] = '/'; $config['cookie_secure'] = FALSE; $config['cookie_httponly'] = FALSE;

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

1
never share your hosting details remove from the questionDexter
I don't care about security now I want it work only ?Cootel Kh
this error is showing becoz you give wrong path your path is application/views/errors/html/error_404.phpDexter
Not this one I change it more and more time I try 2weeks but still not wrokCootel Kh
My boos nearly kill me nowCootel Kh

1 Answers

5
votes

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.