Should I put .htm at the end of my URLs?

The tutorials that I read say to do this, but none of the sites I use do this. Why not?

+6
url website
source share
5 answers

none of the sites that I use [put .htm in urls] Why not?

Simple answer:

Most sites offer dynamic content instead of static html pages.

Longer answer:

The file extension does not matter. All about web server configuration.

The web server checks the file extension, then it knows how to process it (send .html directly to the client, run .php via mod_php and create an html page, etc.). This is customizable.

The web server then sends the content to the client (static or generated), and the http protocol includes indicating to the client the type of content in the headers before sending the web page.

By the way, .htm is no longer required. We no longer use DOS with 8.3 file names.

Make it even harder: :-)

The web server can rewrite URLs. For example, it can redirect all form URLs: www.foo.com/photos/[imagename] to the actual script located at www.foo.com/imgview.php?image=[imagename]

+8
source share

The .htm extension is an abomination left over from the days of file name length restrictions 8.3. If you write HTML, it is more correctly stored in the .html file. Keep in mind that the URL you see in your browser does not necessarily correspond directly to some file on the server, so you rarely see .html or .htm in anything other than static sites.

+2
source share

I assume you are reading tutorials on creating static html pages. Most sites are dynamically generated from programs that use a URL to determine the content that you see. URL not attached to file. If there are no such dynamic programs, then the files are URLs that are singular.

0
source share

If you can, leave the .htm value (or any file extension). It does not add anything to the use of the site and provides non-local details in the URL.

0
source share

No need to put .htm in your URLs. It not only reveals unnecessary information about your site, but also means that there is less space for other characters in your URLs.

It’s true that the URL can be insanely long ... but if you send a long link by email, it will break often. Not everyone uses TinyURL, etc., so it makes sense to keep your URL short enough so that it doesn't get truncated in emails. These four characters (.htm) can affect the truncation of your email address or not!

0
source share

All Articles