September 5, 200817 yr Hi I was wondering how everyone else manages their website - at the moment I try to have as few html pages as possible in the root directory, and then have other pages in relevant directories. I then have a /media/ folder which is then split into: /media/graphics/ /media/site-content-images/ /media/php/ /media/ajax/ /media/javascript/ /media/stylesheets I have the top two where /graphics are for images that are used throughout the site for layout purposes, /site-content-images/ is used for images in articles, for example I'd be really interested in seeing what other people do to maintain a clean and tidy site hierarchy - any tips?
September 5, 200817 yr Having the media folder adds an extra layer of complexity that might not be needed. It also adds extra code to your site, but might not be an issue unless it's a high traffic one. Personal I like to have all the main folders in the root like this: /images /script /styles /includes /etc
September 5, 200817 yr Author Hi Badmotherz You're probably right there, I guess I like to have the root directory with less files in; for high traffic websites would adding the media folder really increase strain on bandwidth like you say? Out of interest, what sort of files are you putting in /includes and /etc TidySi Having the media folder adds an extra layer of complexity that might not be needed. It also adds extra code to your site, but might not be an issue unless it's a high traffic one. Personal I like to have all the main folders in the root like this: /images /script /styles /includes /etc
September 5, 200817 yr Heres the general directory tree I use: /css - Stylesheets main.css navigation.css text.css ie.css /img - Images, usually has quite a few sub-directories like: headers icons logos /inc - PHP Classes, wrappers and framework code etc for example: mysql.wrapper.php /js - Javascript /lib - Library of PHP file includes and scripts like: homepage.php header.php body.php footer.php navigation.php I usually have a "junk" directory too for things like original images. I find it easier and quicker working with short names in the long run although theres a limit to how small a directory name can be without confusing yourself
September 5, 200817 yr normally mine goes /images /style ------>css JS things that style the site /includes ---->for php includes, text files, php files...basically files that are included in the page /originals -----> psds, and back ups of original files, normally this folder is called something random rather than originals
September 5, 200817 yr I try to keep my structure as shallow as possible. I think it looks better in the address bar and search engine crawlers don't like deep folder structures. I usually have: /images /notes (bits and pieces I make a note of while building a large site) /styles /psd
September 5, 200817 yr /css /js /images /includes and then if I have an image gallery for example I may make a folder called /gallery which has a subfolder called /thumbs other than that, as simple but organised as possible
September 5, 200817 yr I usually go for smth like: /application (holds app specific php files) /css /htc (if needed for IE) /images /js /NAME_OF_FOLDER 1 (folder for some user uploads, might have subfolders) /NAME_OF_FOLDER 2 (folder for some user uploads, might have subfolders) /system (holds the Code Igniter base files) .htaccess index.php
September 6, 200817 yr I prefer to have quite a few folders... everything should have its place. In my opinion it makes it much easier to edit scripts because you instantly know where to look for them. as of the minute, my site in progress has following structure: /www (4 folders, 8 files) - /images (1 folder, 1 file) - - /template (5 files, 1 folder) - - - /adverts (1 file) - /javascript (2 files) - /stylesheets (2 files) - /php_incudes (2 folders, 0 files. Directory password protected with no valid users) - - /template (2 files) - - /scriptlibrary (5 folders 0 files) - - - /antihack (2 files) - - - /database_functions (1 file) - - - /loginscript (5 files) - - - /registration (2 folders) - - - - /form (2 files) - - - - /executereg (0 files yet) - - - /validators (3 files)
Create an account or sign in to comment