3

Our code are as below

application/config/config.php

$config['base_url'] = 'http://myworldmirror.com/';  
$config['index_page'] = 'index.php/home';

.htaccess

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
Options -Indexes

application/config/database.php

$active_group = 'default';
$query_builder = TRUE;

$db['default'] = array(
    'dsn'   => '',
    'hostname' => 'localhost',
    'username' => 'newsels1',
    'password' => 'newsels1',
    'database' => 'newsels1',
    'dbdriver' => 'mysql',
    'dbprefix' => '',
    'pconnect' => FALSE,
    'db_debug' => (ENVIRONMENT !== 'production'),
    'cache_on' => FALSE,
    'cachedir' => '',
    'char_set' => 'utf8',
    'dbcollat' => 'utf8_general_ci',
    'swap_pre' => '',
    'encrypt' => FALSE,
    'compress' => FALSE,
    'stricton' => FALSE,
    'failover' => array(),
    'save_queries' => TRUE
);

Output

When I open this url "http://myworldmirror.com/", the output below is shown

Error image

3
  • change config['index_page'] = 'index.php/home'; to config['index_page'] = '';
    – Mohammad
    Feb 2, 2017 at 12:52
  • Hello mohammad try this code but show same error
    – Nxsol Team
    Feb 2, 2017 at 13:17
  • Solved my problem : Thank you bro
    – Nxsol Team
    Feb 2, 2017 at 13:44

3 Answers 3

3

Try this

Change $config['index_page'] = 'index.php/home'; To $config['index_page'] = '';

.htaccess

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?$1

Check Your default controller value in application/config/routes.php

$route['default_controller'] = 'welcome';

check application/controllers/Welcome.php exist or not otherwise change $route['default_controller'] value as your requirement

5
  • Are you sure you can set valid value of default_controller ? Feb 2, 2017 at 13:15
  • Which value of $route['default_controller'] ? Feb 2, 2017 at 13:16
  • $route['default_controller'] = 'home' & controller/home.php is available
    – Nxsol Team
    Feb 2, 2017 at 13:19
  • Please rename controller/home.php To controller/Home.php Feb 2, 2017 at 13:19
  • Solved my problem : Thank you bro
    – Nxsol Team
    Feb 2, 2017 at 13:44
2

Since I was not able to provide accurate solution to your problem, Please try below methods.Any one of the mothod works then we can find a solution.

  1. remove your .htacces file and update $config['index_page'] = ' '; now just try the URL http://myworldmirror.com/index.php/home or http://myworldmirror.com/index.php. (If this method works then you have a problem with your .htaccess file).

  2. In config/database.php just replace 'dbdriver' => 'mysql', with 'dbdriver' => 'mysqli' and try.

Please let me know the result.

1
  • Solved my problem : Thank you bro
    – Nxsol Team
    Feb 2, 2017 at 13:44
2

http://myworldmirror.com/Home is work .

you change

$route['default_controller'] = 'Home';

to

$route['default_controller'] = 'home';
2
  • @NxsolTeam Fixed now ?
    – Mohammad
    Feb 2, 2017 at 13:35
  • Solved my problem : Thank you bro
    – Nxsol Team
    Feb 2, 2017 at 13:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.