File & Folder Structure of a Website It’s important to keep the contents of your website organized.. BASIC STRUCTURE OF A WEBSITE THE ULTIMATE WEB DESIGNER • BRAD HUSSEY... File & Folde
Trang 2File & Folder Structure of a Website
It’s important to keep the contents of your website organized Folders should have simple one word names Multi-word
names can be faked by using the underscore “_” character, like so:
product_images
course_files
etc
BASIC STRUCTURE OF A WEBSITE
THE ULTIMATE WEB DESIGNER • BRAD HUSSEY
Trang 3File & Folder Structure of a Website
In the root folder of your site (“root” is the common name for the top-level directory of a website) you’ll place an HTML
document called index.html
index.html is the homepage—the first page visitors see when they arrive at your site
Trang 4File & Folder Structure of a Website
The index.html filename is set in stone because Unix-based HTTP servers are configured to look for a document named index.htm or index.html when no additional filename is
specified in the address bar
http://website.com → http://website.com/index.html
BASIC STRUCTURE OF A WEBSITE
THE ULTIMATE WEB DESIGNER • BRAD HUSSEY
Trang 5File & Folder Structure of a Website
You will also have a folder reserved for your images This
folder is usually called images or img
Let’s take a look at the typical file/folder structure of a simple website…
Trang 6BASIC STRUCTURE OF A WEBSITE
THE ULTIMATE WEB DESIGNER • BRAD HUSSEY
MyWebsite
Trang 7index.html
Trang 8BASIC STRUCTURE OF A WEBSITE
THE ULTIMATE WEB DESIGNER • BRAD HUSSEY
MyWebsite
Trang 9logo.jpg
Trang 10BASIC STRUCTURE OF A WEBSITE
THE ULTIMATE WEB DESIGNER • BRAD HUSSEY
MyWebsite
logo.jpg
downloads
Trang 12BASIC STRUCTURE OF A WEBSITE
THE ULTIMATE WEB DESIGNER • BRAD HUSSEY
Trang 14BASIC STRUCTURE OF A WEBSITE
THE ULTIMATE WEB DESIGNER • BRAD HUSSEY
Trang 15index.html images
downloads biographies things.html brad.html
Navigating to things.html within the downloads folder would look like this:
www.website.com/downloads/things.html
Trang 16BASIC STRUCTURE OF A WEBSITE
THE ULTIMATE WEB DESIGNER • BRAD HUSSEY
Trang 17File & Folder Naming Conventions
The name of any file or folder you create as part of your
website structure will eventually become part of a URL
URLs have some restrictions as far as the characters that can
be used within them, so it’s important to be aware of them
Trang 18These characters are not allowed in URLs
BASIC STRUCTURE OF A WEBSITE
THE ULTIMATE WEB DESIGNER • BRAD HUSSEY
Trang 19Special characters used in URLs
Trang 20Spaces are NOT ALLOWED in URLs
Fake spaces by using the underscore “_”, like so:
my_website
cute_dog
awesome_things
BASIC STRUCTURE OF A WEBSITE
THE ULTIMATE WEB DESIGNER • BRAD HUSSEY
Trang 21URLs are mostly case-sensitive
If you have an image called logo.jpg and you reference it in your HTML as Logo.jpg the server probably won’t find it
Trang 22The best approach
It’s widely accepted among most professional web developers to use only lower-case alphanumeric characters and the underscore when naming files & folders
So, instead of this:
BASIC STRUCTURE OF A WEBSITE
THE ULTIMATE WEB DESIGNER • BRAD HUSSEY