ASWCode Tutorials

Learn Web Development - From Basics to Advanced

HTML File Naming

Choosing the right file name for your HTML pages is important. Proper naming keeps your website organized, prevents errors, and improves SEO.

1. File Extension

HTML files should end with .html (using .htm is outdated):

index.html
about.html
contact.html

2. Use Lowercase Letters

Always use lowercase letters, especially on Linux/Unix servers, as file names are case-sensitive:

home.html     ✅
Home.html     ❌ (may fail on some servers)

3. Avoid Spaces

Do not use spaces in file names. Use hyphens - or underscores _ instead:

my-page.html     ✅
my_page.html     ✅
my page.html     ❌

4. Use Meaningful Names

Choose names that describe the content of the page:

index.html          → Homepage
about.html          → About page
contact.html        → Contact page
css-tutorial.html   → CSS tutorial

5. Avoid Special Characters

Do not use characters like ! @ # $ % ^ & * () in file names.

Next Lesson → HTML Keyboard Shortcut Cheat Sheet

Previous Lesson → HTML vs XHTML

← Back