CodeIgniter Forums
directory structure CI4 - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forum-28.html)
+--- Forum: CodeIgniter 4 Discussion (https://forum.codeigniter.com/forum-31.html)
+--- Thread: directory structure CI4 (/thread-74668.html)



directory structure CI4 - captain-sensible - 10-22-2019

So the index.php in CI4 has been moved to public. For development its not that great a big deal to set up virtual hosts in /etc/httpd/httpd.conf and tweak /etc/hosts

However on hosting its not uncommon to have several directories in your hosting account and basically when domain points to a directory say nextbigthing  then when somebody puts url nextbigthing.org  it points to directory nextbigthing and server is looking for some index.html or in a php framework a bootstrap index.php

So the only thing i can think of if i upload CI4.zip to my server  for a project is   to use some form of re-direct from Cpanel so that a live url  for nextbigthing.org actually will get pointed to the public dir of codeigniter dir structure of project.

Is that the way it is envisaged things  will be done or maybe use a  .htaccess in  root of web project ?


RE: directory structure CI4 - ciadmin - 10-22-2019

I use cpanel/whm for my VPS servers, and the only domain that is awkward to handle is the main domain associated with an account, which maps to public_html. All of the other addon domains or subdomains can be mapped to a public folder inside an appropriate project root.


RE: directory structure CI4 - captain-sensible - 10-22-2019

(10-22-2019, 06:29 AM)ciadmin Wrote: I use cpanel/whm for my VPS servers, and the only domain that is awkward to handle is the main domain associated with an account, which maps to public_html. All of the other addon domains or subdomains can be mapped to a public folder inside an appropriate project root.

yes thats what i've got about 5 addon domains inside one main hosting account ; so basically you concur then that thats the best way to do it ; map url  to addon domain to public dir.

It looks like CI4 is not production ready yet; i won't be using it until i re-learn it, last time used was when  ellislab was lead dev.


RE: directory structure CI4 - John_Betong - 10-22-2019

@captain-sensible

I used to use sub-domains but far prefer to use a free domain, Freenom.com has numerous available...

With only having a single domain it can easily get confusing... registering a free domain and using the new domain as a staging server until it is ready to be permanent is far easier than using a sub-domain.


RE: directory structure CI4 - kilishan - 10-22-2019

Last time I checked, all major PHP frameworks used a public folder now for security reasons. A quick search for installing Laravel on CPanel brought up this post that talks about the changes needed for addon and primary domains.


RE: directory structure CI4 - captain-sensible - 10-23-2019

(10-22-2019, 10:02 AM)kilishan Wrote: Last time I checked, all major PHP frameworks used a public folder now for security reasons. A quick search for installing Laravel on CPanel  brought up this post that talks about the changes needed for addon and primary domains.
yes thats the facility i have on my hosting via cpanel , i 've seen it but never used it before ,but obviously will have to in future.

For now i have CI4 set up and working (apache on Slackware) via  localhost - virtual host in /etc/httpd/httpd.conf and an added entry on /etc/hosts .That will do for now , since its going to be a return to learning curve for CI