Re: meta redirect - on removing .htm extension, Firefox displays HTML - Why?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
David Smithz wrote in

Quoted text here. Click to load it

I know its not the meta redirect answer you sought but...

...if you were to make a sub-directory called "downloads", put your
downloads.htm file in there and rename it to index.htm(l) then anyone typing would get the page currently accessed as

It may be worth mentioning that there are usability and search engine
problems associated with the meta redirect.

If you feel that any of the above is incorrect,
inappropriate or offensive in any way,
please ignore it and accept my apologies.

Re: meta redirect - on removing .htm extension, Firefox displays HTML - Why?

Quoted text here. Click to load it

Actually, I do have that system in place already for other pages, but in
this case I do now want to setup a specific folder.

Quoted text here. Click to load it
I did not know that so thanks. Then again, in this circumstane, this is not
a page I want particular available to public, just for people I tell so
there is no link from the main website.

Thank you for your input.

Re: meta redirect - on removing .htm extension, Firefox displays HTML - Why?

Thanks for your truly useful comments Alan.

I started looking into this and it certainly looks the way forward.
Considering I'm on a shared hosting accounts, is one able to do the
necessary changes to the Apache server ( I know it is probably different for
each host, but generally).

Also, despite reading a lot of the information sent, I'm still a long way
from understanding how to do it. Is there anywhere just a quick example of
where I actually make the changes and what I need access to.

A lot of the links assumed knowledge of things I am not yet familar with and
in the short term I wanted to get things up and running ASAP. I will then
look to make it work the proper way.

I know I have access to .htaccess file with my host. Would that be
somewhere, where I could make these changes?

Thanks and sorry for newbieishness of my question.


Re: meta redirect - on removing .htm extension, Firefox displays HTML - Why?

On Sun, 30 Apr 2006, David Smithz wrote:

Quoted text here. Click to load it


OK, let's start by trying to answer the question which you actually

The key to your redirection (as I hope you already read in the cited
supporting materials) could be some flavour of Apache Redirect
statement (in your .htaccess file, that is).

Redirect 301 /downloads

(301 is the permanent status already mentioned).

There are much more elaborate possibilities as one moves along,
including RedirectMatch with regular expressions; Redirect or
RedirectMatch inside <Files...> brackets; and, when simple solutions
fail, the "Swiss Army Knife" of rewriting URLs with mod_rewrite.

Quoted text here. Click to load it

Not at all - we all have to start somewhere.  The important point is
to want to learn ;-)  

Peter McC has already suggested one alternative approach, namely to
turn downloads into a directory and put your page as its default
document - by convention index.htm or index.html ...

However, as exhibited, that was slightly sub-optimal, since navigating
to is going to cause the web server
to redirect to (with the trailing
"/") before it returns the default document.

*If* you decided to follow that approach, your references should
really be directly to , so as to
avoid the unnecessary redirection transaction.

Another approach is to leave the web server to supply the missing
filename extension internally, without mentioning it on the URL.
In this case, no redirection transaction takes place: the document
is directly referenced by its URL
despite the fact that your actual file, internal to the server, is
called downloads.htm (or .html, as the case may be).  If you activate
MultiViews then you can have this and much else - but that would take
us off into lots of other detail.

Changing the subject again: you had a question to which I suspected
the answer was that your server was returning text/plain as the
content type.  You didn't say anything in your followup to confirm or
deny that, but you might want to know how to influence that...

It's unlikely to be a good idea to set the server's default
content-type to be text/html, since in general there could be all
manner of unknown content types which it would be harmful to serve out
as text/html.

By convention, there's been two "schools of thought" about what to do
with unknown content-types.  One is to serve them out as text/plain in
the hope that the reader will be able to make some sense of them
anyway.  This can be particularly useful when there are miscellaneous
files lurking around with names like README or CHANGELOG or INSTALL.  
But not so useful if the files of unknown type contain binary
executables and what not.

The other school of thought is to make the general default type to be
application/octet-stream (which in effect means "this is some bag of
bytes and I don't know what it's for, you might as well download it").

And then to take care to provide some special configuration for files
which, although they are without filename extensions, it's known that
they were meant to contain text, or some other definite content-type.

hope this is useful - it's really an open-ended topic, could go on and
on - but take what you need for now, and look to learn more when you
need it later.

Re: meta redirect - on removing .htm extension, Firefox displays HTML - Why?


I've got it working using the redirects and I really like it. Now on any
websites I do I can setup redirects like this as I think it's useful to be
able to type in the domain name and then just type a keyword (e.g. to be taken to wherever that information is on the

It seems to work fin so thanks for all your input Alan,

Incidentally I did not use the 301 in front of the original path like you
have in your example, but I assume this is OK.

As for what my host served as default content, I was unsure, but from
getting an understanding with the help of your post in the last few hours I
believe it is text/plain.

Thanks again.


Site Timeline