Folder structure for a website

Started by Kythia, March 12, 2016, 06:36:08 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Kythia

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
242037

AmberStarfire

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.



Kythia

Quote from: AmberStarfire 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.

Why's that bad?

QuotePersonally, 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.
242037

AmberStarfire

#3
Quote from: Kythia on March 12, 2016, 12:21:32 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).


Vekseid

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. >_>

AmberStarfire