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?
Name your webpage index.html and the server will default there when someone enters the truncated URL.
Sorry, in your case you would create a subdirectory named “funstuff” and put the index.html and related files in there.
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.
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.
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.
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.
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.