Do I need the ".html" suffix on my files?

J

Jeff

I'm sure this is a very elementary question, but when I create html
files to upload they have the ".html" extension by default, but I also
noticed when that's the case the address has to include the suffix as
well to access the page. For example:

www.whatever.com/hello

vs.

www.whatever.com/hello.html

Is it the norm to simply leave off the suffix on the files so the suffix
won't have to be added on when someone types the page's address?

(I'm using OS X with an old copy of ClarisHomePage and Fetch.)

Thanks,

Jeff
 
N

Neal

I'm sure this is a very elementary question, but when I create html
files to upload they have the ".html" extension by default, but I also
noticed when that's the case the address has to include the suffix as
well to access the page. For example:

www.whatever.com/hello

vs.

www.whatever.com/hello.html

Is it the norm to simply leave off the suffix on the files so the suffix
won't have to be added on when someone types the page's address?

Depends.

In a plain vanilla site, you must specify the extension.
www.whatever.com/hello will generally lead the browser to look for
www.whatever.com/hello/ - a directory.

However, Google for "MultiViews".
 
M

Mitja

Jeff said:
I'm sure this is a very elementary question, but when I create html
files to upload they have the ".html" extension by default, but I also
noticed when that's the case the address has to include the suffix as
well to access the page. For example:

That's simply because the extension is a part of the file name, same as
stuff before the last dot.
www.whatever.com/hello

vs.

www.whatever.com/hello.html

Is it the norm to simply leave off the suffix on the files so the
suffix won't have to be added on when someone types the page's
address?

Nope, it's the other way round. Suffixes help identify the file type (is it
a GIF image? A script? A PDF document? A ZIPped file?) - there are ways to
make it work without the extensions, but unless you don't really know what
it is you want to achieve I recommend leaving things the way they are
(_with_ extensions, that is).
 
R

Richard

Jeff said:
I'm sure this is a very elementary question, but when I create html
files to upload they have the ".html" extension by default, but I also
noticed when that's the case the address has to include the suffix as
well to access the page. For example:

www.whatever.com/hello

vs.

www.whatever.com/hello.html

Is it the norm to simply leave off the suffix on the files so the suffix
won't have to be added on when someone types the page's address?

(I'm using OS X with an old copy of ClarisHomePage and Fetch.)

Thanks,

Jeff


many hosts will require either htm or html or none or either.
technically, you can name it anything you'd like, but you'd have to link to
it with that precise name.

www.example.com/example would default to what ever the host has it set as.
www.example.com/example.xxx could only be reached by naming the extension as
an exact match.
 
N

Neal

.oO(Neal)


Or to a file called 'hello'.

It's the server that looks and sends a 301 redirect to the browser if
necessary (or a 404 if no appropriate resource was found).

I accounted for that in the part of the post you didn't quote. For the
beginner (note "elementary question") what I wrote is true and accurate.
 
J

Jeff

Michael Fesser said:
.oO(Neal)


Or to a file called 'hello'.

Well I guess my question is, will most (or all) browsers recognize files
that have no .html extension, as html files? It appears with most sites
it's not necessary to add ".html" to address a page....

It's the server that looks and sends a 301 redirect to the browser if
necessary (or a 404 if no appropriate resource was found).

Micha

Thanks again Micha and everyone,

Jeff
 
T

Toby A Inkster

Jeff said:
Well I guess my question is, will most (or all) browsers recognize files
that have no .html extension, as html files? It appears with most sites
it's not necessary to add ".html" to address a page....

The file name DOES NOT MATTER. All that matters is that the web server
sends out the correct MIME type (text/html).
 
M

Michael Fesser

.oO(Jeff)
Well I guess my question is, will most (or all) browsers recognize files
that have no .html extension, as html files?

Names and extensions don't really matter in the WWW. A browser doesn't
request a file, it request a resource with a specific URL. Then it's up
to the server to deliver that resource with an appropriate content-type,
so the browser knows how to handle it.

A HTML document should be delivered as text/html, whether its URL ends
on .html, .foo or nothing at all doesn't matter.

Micha
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top