Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

url

web

The tutorials I'm reading say to do that, but none of the websites I use do it. Why not?

like image 559
Brooke Avatar asked Jun 04 '09 19:06

Brooke


1 Answers

none of the websites I use [put .htm into urls] Why not?

The simple answer would be:

Most sites offer dynamic content instead of static html pages.

Longer answer:

The file extension doesn't matter. It's all about the web server configuration.

Web server checks the extension of the file, then it knows how to handle it (send .html straight to client, run .php through mod_php and generate a html page etc.) This is configurable.

Then web server sends the content (static or generated) to the client, and the http protocol includes telling the client the type of the content in the headers before the web page is sent.

By the way, .htm is no longer needed. We don't use DOS with 8.3 filenames anymore.

To make it even more complicated: :-)

Web server can do url rewriting. For example it could redirect all urls of form : www.foo.com/photos/[imagename] to actual script located in www.foo.com/imgview.php?image=[imagename]

like image 198
John Smith Avatar answered Nov 08 '22 10:11

John Smith