website directory structure

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I am learning HTML/JacaScript/CSS/PHP5/MySQL/XML from books and WWW.
I am creatinga website using these technologies.
I would like to ask experienced PHP programmer how to design structure of
subfolders. Here's what I made:

.: Main directory containg index.php page, other web pages accessible by
website users, .php scripts called by <form>s, file styles.css.
./images: PNG, GIF and JPEG images.
./include: JavaScript <link>ed files of utility functions, .inc.php
includes, (website configuration file).
./secure: Web pages accessible through SSL, .htaccess and .htpass files,
protected .php scripts with some .inc.php includes, website log file.
./secure/backups: Backups of database and backups of website log.

What do you think of my idea?
Of course more complex website would consist of more complicated structure
of larger number of folders.

Re: website directory structure

Jivanmukta wrote:
Quoted text here. Click to load it

I put included files (especially ones with passwords, configuration
info, etc.) outside of the website's root directory.  That way it cannot
be downloaded, even if there is a glitch in the web server.  I also
don't have a special directory just for secure pages.  I do, typically,
have at least one images directory (more if there are lots of images, of
which some are special purpose.

And I keep backups off site.

Other than that, it's whatever works for you.  But I try to keep the
directories related to the web structure, i.e. if I have a general
products page which links to "doodads", "gadgets" and "widgets", each of
which links to more pages, I might have something like (assuming
products is in the root) /doodads, /gadgets and /widgets.

Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.

Re: website directory structure

Quoted text here. Click to load it

Maybe this is of interest:

As Jerry said, keep everything that does not need to called from a
browser outside the web root. Especially sensitive files like files
containing passwords.

Best regards,
Willem Bogaerts

Application smith
Kratz B.V. /

Site Timeline