Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File organization for web site developers

Status
Not open for further replies.

JoJ

Programmer
May 3, 2002
71
CA
Want to share your folder organization system?

Here's a very basic one that I might use:

[tt]
shared> images>
scripts>
styles>

site1> images>
scripts>
styles>

site2> images>
scripts>
styles>
[/tt]

Did I miss a group or another level.

What points do I need to consider?

Here's what I remember for now:
- i try not to over organize
- avoid too many levels away from the root
- don't have duplicate files everywhere. Use the shared folder instead (e.g. url(../../shared/images/pixel.gif) )

Your thoughts...
 
I'm not entirely sure what it is you are asking for... but here's some advice anyway:

Each job is different. You cannot always assume that a folder structure that works well for one project will work well for another. In doing so, you may well miss out on the chance to create a structure that would enhance and streamline a particular project.

Hope this helps,
Dan

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Dan has a point about setting your structure to fit the task at hand. Also, the way your web server is set up will affect what goes where. Having said that, here's how I organise my websites offline on my PC:
[tt]
My Websites
+--- SiteName1
| +--- cgi-bin
| | +--- ...subdirectories as required...
| |
| +--- public_html
| | +--- images
| | +--- scripts
| | +--- ... other subdirectories ...
| |
| +--- secure
| | +--- ... subdirectories ...
| |
| +--- working
|
+--- SiteName2
| +--- cgi-bin
| | +--- ...subdirectories as required...
| |
| +--- public_html
| | +--- images
| | +--- scripts
| | +--- ... other subdirectories ...
| |
| +--- secure
| | +--- ... subdirectories ...
| |
| +--- working
(etc.)
[/tt]
The ISP I use puts the cgi-bin outside the public_html directory, others might put it inside. the "secure" directory contains files accessed by scripts in the cgi-bin - it can't be accessed directly from the web. The "working" directory isn't uploaded to the web server - it contains stuff like the original Paint Shop Pro image files that I generate gifs & jpegs from to use online.

Incidentally, I avoid ".." references when pointing to places like the images directory. Instead I'd do [tt]<img src="/images/xxx.gif">[/tt], i.e. use a path that's relative to the root directory rather than the current one. The reason is, if you reorganise your site and move your pages up or down the tree, the image URLs won't get broken.

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
I understand now.

Initially, I was under the impression that code/space management took precedence over individual website's independence. (For instance, in an environment with multiple sites, copies of identical scripts are found in each website folder. I then assumed that creating a "shared" folder for them is being efficient and, when required, the shared script is refactored in only one place.)

So, following Chris's tree, how should one incorporate a site with multiple languages?

[tt]
--- public_html
index.html
index_fr.html
+----images
+----scripts
[/tt]

or

[tt]

--- public_html
+----en
+----fr
+----images
+----scripts
[/tt]

Thanks ahead for any input.
 
I would push for the latter of the two... with the inclusion (optionally) of an images and scripts directory within each language directory (for language specific image and scripts).

Cheers,
Jeff

[tt]Jeff's Page [/tt][tt]@[/tt][tt] Code Couch
[/tt]

What is Javascript? faq216-6094
 
Many multi-lingual sites do not have hard-coded content, choosing instead to go with a database-driven model, avoiding the need for many folders at all.

Just a thought!

Dan


[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top