I am new to the codeigniter framework and I have tried to make my first program but received a 404 page not found
error
This is my root directory Codeigniter
and my directory structure
My source folder contains the .htaccess file containing the following code
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]
Home.php
class Home extends CI_Controller{
public function index(){
$this->load->view('View');
}
}
view.php
echo "HI this is my first codeigniter program";
I have tried the following url http://localhost/Codeigniter/
but I get a 404 error, however http://localhost/Codeigniter/home
loads the correct result even though my actual root folder is Codeigniter
how to solve this problem?
Change route file in this following path:-
CodeIgniter/application/config/routes.php
$route['default_controller'] = 'required_controller';
Then only you can access the following url
http://localhost/Codeigniter/
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments