CodeIgniter Forums
Directory Structure - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Directory Structure (/thread-35129.html)



Directory Structure - El Forum - 10-19-2010

[eluser]Shounak[/eluser]
Hey guys. This is my first time using a framework. Got a question regarding the directory structure.

I have a admin directory. It contains files required for the admin. All the other files are just at the root level. Where should the CI system directory be placed?


Directory Structure - El Forum - 10-19-2010

[eluser]umefarooq[/eluser]
CI system folder should be on you project root, you can take application folder out from system to your project folder root no problem at all


Directory Structure - El Forum - 10-19-2010

[eluser]Shounak[/eluser]
done. any changes in the settings/config files?


Directory Structure - El Forum - 10-19-2010

[eluser]Shounak[/eluser]
should all the sub folders have the application folder?


Directory Structure - El Forum - 10-20-2010

[eluser]tonanbarbarian[/eluser]
the setup that i usually use is something like this

A CodeIgniter folder somewhere that contains everything you get when you unzip the downloaded codeigniter file.

i.e. /usr/share/CodeIgniter
this then contains 2 folders
/usr/share/CodeIgniter/system
/usr/share/CodeIgniter/userguide

This allows many sites on the server to use the same codeigniter core libraries
If you need to run multiple different versions of codeigniter you can
/usr/share/CodeIgniter_1.7.1
/usr/share/CodeIgniter_1.7.2
etc

Then in the user folders but outside of the webroot for the user I have an applications folder in which I place a renamed version of the system/application folder
i.e.
/home/myuser/applications/app1
/home/myuser/applications/app2
/home/myuser/applications/app3

Then finally in the webroot you can include your index.php file, and if you are running several CI apps on the same site you can change the index.php file to something different for each app and then change the index_page in the config.php and modify your htaccess as well
i.e.
/home/myuser/public_html/index.php (links to app1)
/home/myuser/public_html/app2.php (links to app2)
/home/myuser/public_html/app3.php (links to app3)

Or you can place the index.php files in separate folders if you have multiple apps as well