Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How to keep a website tidy

Featured Replies

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?

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

  • 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

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 :pp

normally mine goes

 

/images

/style ------>css JS things that style the site :pp

/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

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

/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

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

 

^_^

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.