Forum Moderators: phranque

Message Too Old, No Replies

.html.gz files not being diplayed.

         

ratzmilk

10:35 am on Sep 15, 2006 (gmt 0)

10+ Year Member



I have a site that creates and stores gziped compressed html files. These end in filename.html.gz.

I've just moved the site to a new sever, but now, when you click on a file, you get prompted to download the html.gz file, rather than the html version simply being displayed in the browser.

I have checked with a couple of the on-line apache header testers and they report that mod_gzip is indeed installed.

Apache version 1.3.33

Any suggestions?

jdMorgan

4:01 pm on Sep 15, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It's most likely that your new server has no defined MIME-type for the .gz filetype. Look at your control panel for MIME-type settings. You'll need to define filetype .gz as MIME-type application/x-compressed or application/x-gzip.

If no such options are available in your control panel, you can do it in your config or .htaccess file using

AddType application/x-compressed .gz

or

AddType application/x-gzip .gz

Jim

ratzmilk

9:46 pm on Sep 15, 2006 (gmt 0)

10+ Year Member



" It's most likely that your new server has no defined MIME-type for the .gz filetype"

Oh yes I do. Mime type application/gzip causes the browser to want to save the file, which is what is is doing at the moment. On account of it being an application and all.

This is the normal function of apache with out the mod_gzip installed.

With mod_gzip installed, apache is supposed to decompress the page on the fly and serv the html page only to the browser. It's a bandwidth reduction tool. You can read more about mod_gzip for apache and how it works by doing a search for mod_gzip on Google.

I have already done the obvious, re-installed mod_gzip, tested the mod is loaded and the server reports that it is. However, apache to doesn't want to decompress them on the fly, as if mod-gzip isn't installed at all.

ratzmilk

11:17 pm on Sep 15, 2006 (gmt 0)

10+ Year Member



Found the answer. It was the mime type.

The mime type "application/gzip gz tgz" needs to be changed to
"application/gzip tgz"

and a new mime type added

"text/html gz"