Skip to content Skip to sidebar Skip to footer

Codeigniter Throws 404 After Uploading To Server

My project runs well on localhost but throws a 404 when I upload the files to a server. Wnen I try to access another page on the system, eg www.myadress.com/newController it throws

Solution 1:

use this.

in config.php

$config['base_url'] = 'https://stackoverflow.com/';
$config['index_page'] = '';
$config['uri_protocol'] = 'AUTO';
$config['url_suffix'] = '';

in .htaccess (This should place out side application folder)

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L] 
</IfModule>

in autoload.php

$autoload['helper'] = array('url');

Post a Comment for "Codeigniter Throws 404 After Uploading To Server"