Ok, this sounds very stupid but I have downloaded several pre-made templates and have found that most of them use the file extension .htm

I'm also worried some browsers may not support or display .htm properly :/

Dani AI

Generated

As asked and as and already pointed out, the two extensions are just naming conventions for HTML files. Browsers render whatever the server serves based on the HTTP Content-Type (text/html), not the filename itself — see MDN on MIME types. Background on filename limits and conventions is covered on Wikipedia.

Practical points worth noting years later:

  • Filesystems differ: Windows hosting is typically case-insensitive, while Linux/Unix hosts are case-sensitive. page.HTM, page.htm and page.html can be distinct on many servers.
  • Default documents: servers often look for index.html or index.htm (configurable; see Apache DirectoryIndex), so consistency avoids surprises.
  • Changing extensions on a live site breaks links unless redirects are added, so prefer consistency or use redirects when migrating.

Quick migration/redirect examples (adjust to site structure and test before deploying):

# Apache (in .htaccess)
RedirectMatch 301 ^/(.*)\.htm$ /$1.html
# Nginx
rewrite ^/(.*)\.htm$ /$1.html permanent;
# Bulk rename on Unix
for f in *.htm; do mv "$f" "${f%.htm}.html"; done

Recommendation: pick one convention (many teams prefer .html for clarity), keep file names consistent, and, when changing existing URLs, add 301 redirects to preserve links and SEO. Modern frameworks and static-site setups often serve extensionless URLs or rely on index.html, so extension choice matters less there but consistency still matters.

Recommended Answers

All 3 Replies

They both mean a html file.
the reason that there is two, is that seriously old computers only supported 3 letters in the file extension. Now that is no longer a problem, but people just haven't moved on.
So just use whatever is easiest for you - some editors make .htm files by default, some .html. Just don't waste your time going round changing them all...

Ok, thanks for the help :D

Its the same pal.. The reason there was a .htm is because a little while back you couldnt have 4 letter extentions.. Exactly the same.. no difference.. but, you can still use .htm if you chose.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.