开发者

how to change mime types in MAMP

I'm developing a website that has a HTML5 video. It looks like when ogg files are served with other mime types than video/ogg firefox flips. I've updated the mime.types file inside the mamp/apache/config folder and have restarted the MAMP server multiple times, but ogg files are still served with plain/text context-type.

Can someone point out what I need to do?

UPDATE

The only time I'm able to change the mime type is if I change the 开发者_Go百科DefaultType text/plain to DefaultType video/ogg which is stupid.


The mime.types file is in Applications/MAMP/conf/apache

There you can alter your mime types. Reset server after changing the file for it to take effect.


Do you have mod_mime_magic installed and enabled? Is your mime magic working correctly? When you do file -m on one of your OGG files, does it say it is a plain text file? Are the file extensions correct?


Adding mime-type is the same for all, it's just you need to understand how the types will be applied and what's the mime-type point is. In this answer I'll how I tried to add WebAssembly mime-type application/wasm in MAMP.

Here it goes:

I recently tried WebAssembly in MAMP and configured out the below mime-type that works for me.

First, we need to navigate the folder of MAMP in MacOS's Applications/MAMP/conf/apache, And then open the file mime.types in any editor.

After opening the file, add the following line anywhere in the mime.types file:

application/wasm wasm

Here is the example wasm mime type in my mime.types file:

#application/wasm
application/wasm wasm


In MAMP Pro these days you can add <VirtualHost> parameters using the gui. Here's a screenshot showing how I add MIME types for .mjs and .wasm as:

AddType application/javascript      .mjs
AddType application/wasm      wasm

screenshot

Don't forget to restart the server after adding.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜