• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Codeigniter Folder Structure For CMS

#4
In the end, you can make almost any directory structure work if you really want to and have time to work it out. However, I prefer a structure like this:

Code:
- /website/
  - application/
  - system/
  - other/
  - public/
    - assets/
      - css/
      - files/
      - fonts/
      - images/
      - js/
    - .htaccess
    - index.php
In this case, /website/public is my DocumentRoot in Apache.

In most cases, I don't need a completely separate website, and many of my assets and much of the application code would be shared, so I would just create the 'admin' site within the 'public' site, using code to control access to the 'admin' site.

If I wanted to add a second website with completely different application code and assets (CSS/JS/etc.), I could add another application directory and another DocumentRoot directory (e.g. 'admin'), but use the same system directory. This also works well if you want to use Apache to manage authentication and authorization, and makes it easier to host the two on separate subdomains, as the DocumentRoot of each subdomain would be set to the appropriate directory.

You stated that in WAMP you access the site like this:
Quote:localhost/mycms/public (For public View)
localhost/mycms/admin (For AdminView)

To me, this implies that the DocumentRoot in WAMP is set to the directory above the 'mycms' directory, rather than having separate websites configured in WAMP with the DocumentRoot set to /mycms/public and /mycms/admin. However, this may just reflect some incorrect assumptions. I'm assuming that you would want to do something like this:

http://testing.website.com - points to /mycms/public
https://admin.website.com - points to /mycms/admin

However, if you wanted to do something like this:

http://testing.website.com - points to /mycms/public
https://testing.website.com/admin - points to /mycms/admin

Then you're back to having one site, with 'admin' existing inside the 'public' site. It's probably possible to do something creative in .htaccess or the apache conf files to route requests from /admin to the 'admin' site without a redirect, but it's not something I've attempted.
Reply


Messages In This Thread
RE: Codeigniter Folder Structure For CMS - by mwhitney - 04-27-2016, 07:41 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.