Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Codeigniter 404 Error On Live Server

i changed my controller name from controller.php to Controller.php also changed my base_url in config file to the directory where my website is hosted like www.abc.com/websitefolder but still i am getting 404 error website url : www.cyfers.com/moving/

my base_url : $config['base_url'] = 'http://www.cyfers.com/moving/';

my .htaccess code

RewriteEngine on
RewriteBase /
RewriteCond $1 !^(index.php|resources|robots.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]

enter image description here

like image 301
adeel pervaiz Avatar asked Aug 06 '26 09:08

adeel pervaiz


1 Answers

Your Base URL should be

$config['base_url'] = 'http://cyfers.com/moving/';

In htaccss

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

Your Controller file should be dashboard.php.

And default controller should be $route['default_controller'] = "dashboard";


To hide errors on site in root there is file call index.php

Change this to

define('ENVIRONMENT', 'development');

this

define('ENVIRONMENT', 'production');
like image 187
Abdulla Nilam Avatar answered Aug 08 '26 00:08

Abdulla Nilam



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!