# How to get rid of '.htm' in URL when creating webpage

**URL:** https://boards.straightdope.com/t/how-to-get-rid-of-htm-in-url-when-creating-webpage/225601
**Category:** Factual Questions
**Created:** [January 22, 2004, 8:01am UTC](https://boards.straightdope.com/t/how-to-get-rid-of-htm-in-url-when-creating-webpage/225601 "2004-01-22T08:01:09Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Charlie\_Tan](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/charlie_tan/32/12582_2.png) [@Charlie\_Tan](https://boards.straightdope.com/u/Charlie_Tan)
#### Post date: [January 22, 2004, 8:01am UTC](https://boards.straightdope.com/t/how-to-get-rid-of-htm-in-url-when-creating-webpage/225601/1 "2004-01-22T08:01:09Z")

</div>

I’ll admit to being an idiot when it comes to web design. However, Dreamweaver makes it almost do-able and I’m slowly getting there. However, one thing that annoys me, when I’m doing a subpage, is that I have to stick .htm at the end of the URL.  
I’ve seen so many pages where it doesn’t look like that. I want to be able to direct people to my page by saying: “Go to mydomain.se/funstuff” because I think that adding .htm makes it less user friendly.  
So I suppose there is a way around this, but I haven’t found it. Any html/dreamweaver wizards among the Dopers?

---

<div class="post-metadata">

### Author: ![Eleusis](https://avatars.discourse-cdn.com/v4/letter/e/f4b2a3/32.png) [@Eleusis](https://boards.straightdope.com/u/Eleusis)
#### Post date: [January 22, 2004, 8:04am UTC](https://boards.straightdope.com/t/how-to-get-rid-of-htm-in-url-when-creating-webpage/225601/2 "2004-01-22T08:04:50Z")

</div>

Name your webpage index.html and the server will default there when someone enters the truncated URL.

---

<div class="post-metadata">

### Author: ![Eleusis](https://avatars.discourse-cdn.com/v4/letter/e/f4b2a3/32.png) [@Eleusis](https://boards.straightdope.com/u/Eleusis)
#### Post date: [January 22, 2004, 8:06am UTC](https://boards.straightdope.com/t/how-to-get-rid-of-htm-in-url-when-creating-webpage/225601/3 "2004-01-22T08:06:18Z")

</div>

Sorry, in your case you would create a subdirectory named “funstuff” and put the index.html and related files in there.

---

<div class="post-metadata">

### Author: ![Colophon](https://avatars.discourse-cdn.com/v4/letter/c/f05b48/32.png) [@Colophon](https://boards.straightdope.com/u/Colophon)
#### Post date: [January 22, 2004, 12:13pm UTC](https://boards.straightdope.com/t/how-to-get-rid-of-htm-in-url-when-creating-webpage/225601/4 "2004-01-22T12:13:09Z")

</div>

If you enter the URL **www.mydomain.se/funstuff** into a browser, it will look for a file at **www.mydomain.se/funstuff/index.htm** (or **index.html** ). So as long as you make sure that the page you want resides at that location, you can give out the shorter version of the URL.

I believe that strictly speaking, such a URL should include a final slash (…/funstuff/), but browsers stick 'em in automatically.

---

<div class="post-metadata">

### Author: ![micco](https://avatars.discourse-cdn.com/v4/letter/m/5f8ce5/32.png) [@micco](https://boards.straightdope.com/u/micco)
#### Post date: [January 22, 2004, 1:38pm UTC](https://boards.straightdope.com/t/how-to-get-rid-of-htm-in-url-when-creating-webpage/225601/5 "2004-01-22T13:38:18Z")

</div>

As **Eleusis** says, you just need to use the default filename, but note that the default name is dependent on the server. The name “index.html” is standard on most Unix servers. Microsoft IIS uses “default.htm” and may or may not be set up to additionally consider “default.html”, “index.htm” and “index.html”. Any given server may be configured for some, all, or none of these options. You can find out how your server is configured by asking the admin or just doing a little trial and error by testing the various typical options listed above.

---

<div class="post-metadata">

### Author: ![Shade](https://avatars.discourse-cdn.com/v4/letter/s/2bfe46/32.png) [@Shade](https://boards.straightdope.com/u/Shade)
#### Post date: [January 22, 2004, 2:29pm UTC](https://boards.straightdope.com/t/how-to-get-rid-of-htm-in-url-when-creating-webpage/225601/6 "2004-01-22T14:29:11Z")

</div>

For that matter, on some servers you can change this yourself. For instance, I have a website running on a unix server of some sort, and used a .htaccess file to turn “something.htm” or “something.html” in an url into “something.php” as all my files had a php extension, but some people wouldn’t know this.

I can’t remember any details, but in the unlikely situation that you have a server that allows you this much control, and you are interested in learning some gory details, someone will hopefully show up and say more.

---

<div class="post-metadata">

### Author: ![iamthewalrus\_3](https://avatars.discourse-cdn.com/v4/letter/i/258eb7/32.png) [@iamthewalrus\_3](https://boards.straightdope.com/u/iamthewalrus_3)
#### Post date: [January 22, 2004, 6:38pm UTC](https://boards.straightdope.com/t/how-to-get-rid-of-htm-in-url-when-creating-webpage/225601/7 "2004-01-22T18:38:49Z")

</div>

Alternately, you could just change the filename to drop the .htm extension, and set the default MIME type on your server to be html. This will tell the server that any document of unknown or nonexistent type will be sent as html (the default MIME type is ususally text).

I’m not sure if this will actually work when IE looks at it, but it will work with standards compliant browsers.

---

<div class="post-metadata">

### Author: ![CurtC](https://avatars.discourse-cdn.com/v4/letter/c/ce73a5/32.png) [@CurtC](https://boards.straightdope.com/u/CurtC)
#### Post date: [January 22, 2004, 7:26pm UTC](https://boards.straightdope.com/t/how-to-get-rid-of-htm-in-url-when-creating-webpage/225601/8 "2004-01-22T19:26:19Z")

</div>

> [@](#):
>
> \*r\_k wrote:\*I believe that strictly speaking, such a URL should include a final slash (…/funstuff/), but browsers stick 'em in automatically.

Sorta. Actually, your browser first asks for a file called “funstuff”, to which the server responds “HTTP/1.x 301 Moved Permanently” and gives a redirect to “funstuff/”. Then your browser asks for this file, and the server sends the default file in that directory.

So if you give someone a URL without the trailing slash, it’s slightly slower and it uses up more bandwidth transferring the extra information.
