CodeIgniter Forums
Getting "First Application" running on remote server - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Installation & Setup (https://forum.codeigniter.com/forumdisplay.php?fid=9)
+--- Thread: Getting "First Application" running on remote server (/showthread.php?tid=79500)



Getting "First Application" running on remote server - acutetech - 06-24-2021

I used Scriptaculous through cpanel to install Codeigniter at my Hostgator shared hosting server, in the root of a domain I have there. It delivers the welcome_message page OK, though the browser reads: http://<mydomain>/public/
I tried to follow the "Build Your First Application" tutorial, and have created the files it specifies (app/Controllers/Pages.php etc) in the hope that this might work, but it doesn't. The tutorial seems to describe operation on a local server and not on the Hostgator server. What do I do different from the "Build Your First Application" tutorial to have it run on the remote server? I suspect some combination of changes in Routes.php plus .htaccess files. Help!
I edited Routes.php to change $routes->setDefaultController('Home'); to $routes->setDefaultController('Pages'); and $routes->get('/', 'Home::index'); to $routes->get('/', 'Pages::index'); Then if I browse to http://<mydomain>/ I am redirected to http://<mydomain>/public and see a version of welcome_message that I modified. Good. But URLs mentioned in the tutorial like http://<mydomain>/pages/view/about etc give 404 errors.
I feel there is something trivial here....


RE: Getting "First Application" running on remote server - InsiteFX - 06-25-2021

Did you set your app/Config/app.php base_url ?

Also make sure that the Controller name starts with an upper case letter.