1

I have an application in CodeIgniter, and upload it to a subdomain Dreamhost throws me the following error:

An Error Was Encountered Unable to load the requested file: sitio/inicio/index.php

I have configured my application as follows:

config.php

$config['base_url'] = 'http://sub.domain.com/';
$config['index_page'] ='';
$config['uri_protocol'] = 'AUTO';
$config['url_suffix'] =''; 

routes.php

$route['default_controller'] = "sitio/inicio"; 

.htaccess

RewriteEngine on
RewriteBase /home/myuser/sub.domain.com/
RewriteCond $1! ^(index\.php|public/img|public/css|public/js|public/uploads|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L] 

inicio.php

class Inicio extends CI_Controller{

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

    function index(){
        $this->load->view('sitio/inicio/index');
    }
}

My default controller is in a subfolder inside controllers, also my view, is in a subfolder inside views. What is the problem? I have tried with some solutions that are in the forum but my problem persists.

Thanks.

  • Can we see what your controller is named? Can you show us the Controller extends... part? – Darren May 23 '11 at 21:46
  • there is my controller... thank's for your help. – toledorobia May 24 '11 at 16:01
  • YOu must first debug your Apache envirnment before examining CI setup. Delete/rename temporarily your .htacces file. Can you access index.php ? Create a sibling index2.php that just do an `echo "hi";` . Can you access it? – leonbloy May 24 '11 at 17:12
  • I renamed the .htaccess file and I have the same error... I can not access the file index.php. Then, I create another file index2.php printing a Hi! I can see it, it works perfectly. – toledorobia May 24 '11 at 18:24
  • On the line where you call "$this->load->view('sitio/inicio/index')", is the path of your view file "application/views/sitio/inicio/index.php" ? My guess is you want to call index.php in the views folder, for which you only need to use "$this->load->view('index')" – Shivaas May 29 '11 at 02:46
  • @Shivaas no, if it's in a subfolder(s) it needs to be referenced as so. 'sitio/inicio/index' is correct. – Aaria Carter-Weir Jun 03 '11 at 10:40
  • It seems that your RewriteBase is wrong, try this: RewriteBase / – Jarek Tkaczyk Jun 08 '11 at 12:20

1 Answers1

0

You're pointing your default route to controller sitio and function inicio. If you want to point your default route to inicio remove sitio

$route['default_controller'] = "sitio/inicio";

afarazit
  • 4,907
  • 2
  • 27
  • 51