codeigniter4 in public hosting problem |
Hi, I have installed my codeigniter4 app on the production server (shared hosting). However, all I can access is the home page (which does look fine); if I try to access any of the other pages I get a 404 error - what is worse, it is not even the CI4 error page (it is default apache 404 page).
The public folder on the server is this: Code: /home/myid/domains/mydomain.lt/public_html/ So, my ci installation (app/, vendor/, .env ...) is located here: Code: home/myid/domains/mydomain.lt/myapp/ Code: /home/myid/domains/mydomain.lt/public_html/index.php Code: app.baseURL = 'https://mydomain.lt/' Code: $pathsConfig = FCPATH . '../app/Config/Paths.php'; Code: $pathsConfig = FCPATH . '../myapp/app/Config/Paths.php'; I know the home controller is run when I access the home page at https://mydomain.lt/ (I see the website homepage), and I know the database can be accessed because I can see the data output through the default method of the default controller (Home.php). But if I try to access that same controller by name - https://mydomain.lt/home/ - I get a default apache 404 error. How do I troubleshoot that? (09-17-2021, 04:04 AM)dgvirtual Wrote: Hi, I have installed my codeigniter4 app on the production server (shared hosting).Feel a complete idiot... I was missing .htaccess file in the public folder - failed to copy it somehow from my dev environment. Sorry for the bother, but I am leaving it here for others to learn.
==
Donatas G.
(09-17-2021, 04:04 AM)dgvirtual Wrote: Feel a complete idiot... I was missing .htaccess file in the public folder - failed to copy it somehow from my dev environment. Sorry for the bother, but I am leaving it here for others to learn. Glad you got it working and thanks for reporting back with your solution.
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/ |
Welcome Guest, Not a member yet? Register Sign In |