You are either not logged in or not registered with our community. Click here to register.
 
April 01, 2023, 02:50:44 am

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

Click here if you are having problems.
Default Wide Screen Beige Lilac Rainbow Black & Blue October Platinum Send us your theme!

Wiki Blogs Dicebot

Author Topic: Folder structure for a website  (Read 1635 times)

0 Members and 1 Guest are viewing this topic.

Offline KythiaTopic starter

  • My smile is like a breath of spring, My voice is soft like summer rain
  • Dame
  • Enchanter
  • *
  • Join Date: Oct 2012
  • Gender: Female
  • And you can not compare with me: Kythia
  • View My Rolls
  • Referrals: 1
Folder structure for a website
« on: March 12, 2016, 06:36:08 am »
So I've been dicking around making a website - not (or probably not) to ever go online, just as a project.  And I don't know how to organise my files: there seems to be a lot of advice around that, all of it different.

What I currently have is (where names in speechmarks are exact names, including capitalisation):

Main Folder
 - various .html files
 - "css" folder
 - - "stylesheet.css"
 - "js" folder
 - - various .js files (or, technically, nothing whatsoever.  Haven't looked at Javascript yet.  But whatevs)
 - "img" folder
 - - various images

Is that a good way of doing it?  Am I creating problems down the line?  Is there a better way?  Any other folders I need

Offline AmberStarfire

  • Rogue Starlight ~ This Is Who We Are ~ Scully to His Mulder ~ Mother of Rabbits
  • Dame
  • Carnite
  • *
  • Join Date: Aug 2008
  • Location: Lost in Our Paradise
  • Gender: Female
  • ❤ Snuggler of the Wyld and Hairy ❤
  • View My Rolls
  • Referrals: 1
Re: Folder structure for a website
« Reply #1 on: March 12, 2016, 09:26:41 am »
That looks fine to me, though sometimes it's a good idea to give folders more unpredictable names so they can't be guessed as easily.

Personally, I'd look for a free CMS like Wordpress or PHP fusion and extract it into the folder associated with the domain. Some hosting companies have quick install scripts for them as well. It's much easier and quicker than building one from the ground up, and some like Wordpress have heaps of plugins and cool things out there you can more easily add.


Offline KythiaTopic starter

  • My smile is like a breath of spring, My voice is soft like summer rain
  • Dame
  • Enchanter
  • *
  • Join Date: Oct 2012
  • Gender: Female
  • And you can not compare with me: Kythia
  • View My Rolls
  • Referrals: 1
Re: Folder structure for a website
« Reply #2 on: March 12, 2016, 12:21:32 pm »
That looks fine to me, though sometimes it's a good idea to give folders more unpredictable names so they can't be guessed as easily.

Why's that bad?

Quote
Personally, I'd look for a free CMS like Wordpress or PHP fusion and extract it into the folder associated with the domain. Some hosting companies have quick install scripts for them as well. It's much easier and quicker than building one from the ground up, and some like Wordpress have heaps of plugins and cool things out there you can more easily add.

Oh, I've no doubt.  But I'm not certain I ever want it online or anything, this is just something for me to play with - third party support would kind of negate the purpose at the moment.  If I ever decide its a real website rather than a toy/hobby then I may look at them (and thanks for the recommendation) but at the moment I'm having fun dicking around and reading W3C schools for everything I want.

Offline AmberStarfire

  • Rogue Starlight ~ This Is Who We Are ~ Scully to His Mulder ~ Mother of Rabbits
  • Dame
  • Carnite
  • *
  • Join Date: Aug 2008
  • Location: Lost in Our Paradise
  • Gender: Female
  • ❤ Snuggler of the Wyld and Hairy ❤
  • View My Rolls
  • Referrals: 1
Re: Folder structure for a website
« Reply #3 on: March 12, 2016, 12:42:06 pm »
Why's that bad?

It's easier for people to hack or explore in ways you might not intend. For instance, when people create a Wordpress site, there are typical names that each of the folders will have. Other changes would be required if someone changed the folder names, but it's what some people do to make their site 'less predictable' and more secure.

On a non-Wordpress site, using folder names like 'images' and 'css' is logical, which is why a lot of people do it. If site users type http://www.yourwebsitename.com/images, they might find your directory, and if they do, they might see a directory list of images. You can hide them by dropping in an index.html file, such as is discussed here, so it will load the index file instead:
http://stackoverflow.com/questions/19439348/what-is-the-best-way-to-hide-a-websites-folder-directory-files

And okay. Some people say some not-good things about W3Schools but I like their site a lot. It has a lot of information in one place and it's easy to find what you're looking for. They're actually not connected with the W3C, they just have a similar name. I have a PHP certificate from them (I didn't pay for it though. I got it through a class I studied).
« Last Edit: March 12, 2016, 01:05:45 pm by AmberStarfire »

Offline Vekseid

  • Those who expect service must first serve.
  • God
  • Addict
  • *
  • Join Date: Apr 2005
  • Location: Washington
  • Gender: Male
  • The way to a woman's heart is through her tears.
  • View My Rolls
  • Referrals: 20
Re: Folder structure for a website
« Reply #4 on: March 12, 2016, 02:59:03 pm »
For simple projects - anything I'm not using a cms for - everything goes into one folder. View source on https://elliquiy.com for example.

Life's too short to fret about some of this stuff. >_>

Offline AmberStarfire

  • Rogue Starlight ~ This Is Who We Are ~ Scully to His Mulder ~ Mother of Rabbits
  • Dame
  • Carnite
  • *
  • Join Date: Aug 2008
  • Location: Lost in Our Paradise
  • Gender: Female
  • ❤ Snuggler of the Wyld and Hairy ❤
  • View My Rolls
  • Referrals: 1
Re: Folder structure for a website
« Reply #5 on: March 12, 2016, 04:20:55 pm »
You could do that too. :)