cgm225 Posted May 24, 2008 Share Posted May 24, 2008 What does your directory structure look like for your applications? Where do you put your config files, your media files (like photos, etc), etc? I am curious what the best way to structure my web server directory is... Quote Link to comment Share on other sites More sharing options...
AndyB Posted May 24, 2008 Share Posted May 24, 2008 I suppose the 'best' way is something that's rational with sensibly-named folders. I usually have something like . images (sometimes subfolders here depending on usage) . support (for css, js files and db-conn file) . includes (for files to be included) . downloads (if applicable) . admin (htpassword protected) Quote Link to comment Share on other sites More sharing options...
minidak03 Posted May 24, 2008 Share Posted May 24, 2008 The best structure is the one you can remember unless you want added security, for instance I usually always place my images in a folder called images which makes sense right however if you don't place an index file in this folder as well on some servers someone can type in mypage.com/images/ and see a full indexable list of all your sites images. They can also hot-link to them but there are php tactics which you can use to get around that. For videos its not suggested you place them in a videos folder this folder should be much more complex like 55sdaf65as and a sub-folder in that folder called anything like 54sad564sad5f. The reason I do this with videos is because when people want to hot-link to a video it really does a number on your bandwidth however if you have a flash player to play these videos you can code flash so that its pretty much impossible for the visitor to guess your document structure. For secured and protected files you can always place them in a folder called secure or protected but the true security comes into place in your actual code to restrict access to these files. Your document structure can be whatever makes sense to you but you also really need to think about security in your code to restrict access to your document structure. Quote Link to comment Share on other sites More sharing options...
monkeypaw201 Posted May 24, 2008 Share Posted May 24, 2008 personally speaking, i agree with minidak03 about keeping them easy to remember, so i have directory listing turned off on my server and for some for extra simple security i capitalize the first letter of each folder (ie Images, not images) Quote Link to comment Share on other sites More sharing options...
mithras Posted May 24, 2008 Share Posted May 24, 2008 For my cms i have an index.php, init.php and config.php in the root. All other basic code is in the folder 'include' (database etc). Furthermore there are two folders 'plugins' and 'media'. Both are organized by plugin: /plugin/blog/blog.class.php is the blog controller /media/contact/form.php is the template for the contact form I'd like to rewrite it soon to www and non-www. The non-www folder contains the models and controllers. The www folder contains all media files like images, templates, scripts and so on. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.