How do I bypass mime type for html?

How do I bypass mime type for html?

Post by Stan Busku » Sat, 20 Nov 1999 04:00:00



Hi,
I have a CD with gzip files but have a file suffix of htm. Consequently,
when I attach the CD to my Apache server, the files are serverd as html
files and appear as garble on my brower.

I tried adding the mod_mime_magic module but it seems to ignore files
that are htm.  When I remove the htm file suffix, the browser
recogonized the magic id for the gzip file and properly unzipped the
file. However, when I add the htm suffix it bypasses the identification
process and identifies the file as html.

I also tried removing the html line from /etc/mime.types file, but it
still passes the gzip file as an html file.

Is it possible for the Apache server to ignore the html file suffix and
use the magic is to serve the file?

Thanks,
Stan Buskus

 
 
 

How do I bypass mime type for html?

Post by Gus » Sun, 21 Nov 1999 04:00:00



> Is it possible for the Apache server to ignore the html file suffix and
> use the magic is to serve the file?

You could try editing the mime.types file in $APACHEROOT/conf/mime.types
and channge the line that reads "text/html  html htm" to take out the "htm"
or alternatively make symlinks to all the files on the hard disk with
the correct extension.

"for x in `ls /mnt/cdrom/`; do ln -s $x $x.gz ; done" would do it.

Regards,
        _Gus

--

0x58E18C6D
82 AA 4D 7F D8 45 58 05  6D 1B 1A 72 1E DB 31 B5
http://black.hole-in-the.net/gus/

 
 
 

How do I bypass mime type for html?

Post by Alan J. Flavel » Sun, 21 Nov 1999 04:00:00



> You could try editing the mime.types file in $APACHEROOT/conf/mime.types
> and channge the line that reads "text/html  html htm" to take out the "htm"

I wouldn't advise interfering with the mime.types file.  Leave that
as it is (and update it when necessary by replacing it with a new
distribution copy), then you won't have to worry about maintaining local
peculiarities there.

If you want to override the treatment of a particular filename extension
in Apache, it's better done with an AddType directive.

I think you'll find that the Apache documentation also give this advice.

You can put the AddType wherever you want it: in the configuration,
effective for all parts of the document tree; in the configuration file
within a bracket that confines it to whichever part of the documentation
tree you want, or in an appropriate .htaccess file.

 
 
 

How do I bypass mime type for html?

Post by Gus » Mon, 22 Nov 1999 04:00:00



Quote:> If you want to override the treatment of a particular filename extension
> in Apache, it's better done with an AddType directive.
> I think you'll find that the Apache documentation also give this advice.

Good tip. Cheers for that.

Regards,
        _Gus

--

0x58E18C6D
82 AA 4D 7F D8 45 58 05  6D 1B 1A 72 1E DB 31 B5
http://black.hole-in-the.net/gus/