Welcome Guest, Not a member yet? Register   Sign In
Problem setting up a codeigniter-project on webserver
#1

Hi,

I have a codeigniter-project that I've been developing via my own computer with MAMP-server.
Now I am trying to move this project to a webserver under a subfolder.
When I upload the files and try to open the first screen, I get a 404 error.

Strange thing is that if I upload a clean codeigniter installation under another subfolder to the same server the project opens correctly with a welcome screen. So the server itself should be ok.

I have tried to define in config.php this:

$config['base_url'] = 'http://www.myserver.com/myproject';
$config['index_page'] = 'index.php';

and also this:
$config['base_url'] = '';
$config['index_page'] = 'index.php';

in routes.php I have this:
$route['default_controller'] = 'mainsite';

And I have that mainsite-controller in controllers-folder

If i change the default-controller:
$route['default_controller'] = 'welcome';

..I get an error: "Unable to locate the model you have specified: User_model"
I have added that User_model to autoload.php.

Any ideas? Smile
Reply
#2

Issues I'd look to investigate:

1)Are you models named with a captial first letter?
2)The default route must target a controller in the top level directory.
Practical guide to IgnitedCMS - Book coming soon, www.ignitedcms.com
Reply
#3

Check if your controllers AND models AND libraries are named with a first capital letter.
If your localhost is on a Windows environment, it will work when the file names are in small-caps because Windows is case-insensitive when it comes to file names. On a hosted platform, however, the webserver will be case-sensitive.
Reply
#4

I checked the capital letters as you both adviced and yes that was the problem! I had named my model-files with lowercase-letters althought the classnames were named with capital letters. Thank you!
Reply




Theme © iAndrew 2016 - Forum software by © MyBB