ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Whats the best practice for website structure

March 03, 2009 6:47am

Subscribe [3]
  • #1 / Mar 03, 2009 6:47am

    PaulW

    1 posts

    Newbie here!

    Can anyone recommend the best directory structure for a CI website, including where to store CSS files, images and how to direct CI to find them from the view files?

    For example would use the rewrite or one of the helper files take care of the paths and if so how would you configure this?

    Thanks!

  • #2 / Mar 03, 2009 8:19am

    JayTee

    108 posts

    I don’t think there’s a “best” way, to be honest.  There are a bunch of entries in the wiki that discuss site structure and a few threads in the forum that discuss it.

    My personal favorite is to use 2 folders:
    public
    system <—the CI system folder, which you’d probably want to rename

    The public folder contains my css, javascript, file downloads, and images
    public
      |-css
      |-js
      |-images
      |_files

    I use the CI helpers for generating links to everything in my views, so I don’t worry much about the paths.

  • #3 / Mar 03, 2009 8:28am

    jdfwarrior

    444 posts

    I use the same setup as JayTee. System and Public folders, with css and all in the public folder.

  • #4 / Mar 03, 2009 10:52am

    PaulW

    1 posts

    Thanks,

    I have the ‘url’ helper working now but i think the issue maybe the rewrite file.

    I am using IIS and for some reaason this stops the ‘url’ helper form working, the dynamic path which is generated by the helper is completley blanc (seems to be ignored when IIS rewrite is on).

    Also I am not sure if its working properly. I have had no problems in the past using IIS rewrite.

    IIS Rewrite rules.

    RewriteEngine on
    RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico)
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php/$1 [L,QSA]

    Any ideas!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases