简体   繁体   中英

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 a 500 internal server error. What could be the problem? This is what my routes look like

$route['default_controller'] = 'home';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;

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');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM