Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setup CodeIgniter site on Godaddy hosting

I am trying to upload my code-igniter site on Godaddy hosting. but getting 404 page not found error.

Project structure

root/public_html/project

I am trying to access the project at www.site.com/project

My .htacess file

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

Important things in config.php

$config['base_url'] = '';
$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';
$config['allow_get_array'] = TRUE;
$config['enable_query_strings'] = FALSE;

Important things in routes file

$route['default_controller'] = 'main';

I have tried so many .htacess files and config edits but couldn't sort the issue out. Please help

like image 533
Hassan-Zahid Avatar asked Apr 22 '26 18:04

Hassan-Zahid


1 Answers

Model,Controller and other libraries must start with a capital letter in codeigniter ( godaddy )

If you didnt make it work with .httacces , you should follow the new standars since codeigniter 2.x to 3.x ->.

Codeigniter 2.X

https://ellislab.com/codeigniter/user-guide/general/models.html

Codeigniter 3.X

http://www.codeigniter.com/user_guide/general/models.html

https://raw.githubusercontent.com/EllisLab/CodeIgniter/develop/user_guide_src/source/installation/upgrade_300.rst

Model,Controller and other libraries must start with a capital letter.However, in some PHP servers like XAMPP this is omitted, so in localhost you should get follow these changes. Just start to type uppercase your php classes.

For example, if you have the following library file:

application/libraries/mylibrary.php

... then you'll have to rename it to:

application/libraries/Mylibrary.php

The same goes for driver libraries and extensions and/or overrides of CodeIgniter's own libraries and core classes.

application/libraries/MY_email.php application/core/MY_log.php

The above files should respectively be renamed to the following:

application/libraries/MY_Email.php application/core/MY_Log.php

Controllers:

application/controllers/welcome.php -> application/controllers/Welcome.php

Models:

application/models/misc_model.php -> application/models/Misc_model.php

like image 164
diego matos - keke Avatar answered Apr 24 '26 08:04

diego matos - keke