0

我想让我的 Cherokee 为我的 xml 文件提供特定的 mime 类型。现在它只为所有 xml 文件提供 mimetype application/xml。

在 apache 中,可以在 /etc/apache2/apache2.conf 中编写以下内容。

<directory dir>
    AddType application/a a.xml
    AddType application/b b.xml
    AddType application/c c.xml
    AddType application/d d.xml
</directory>

因此,例如 dir/a.xml 始终使用内容类型 application/a 提供服务。我可以在切诺基做类似的事情吗?

4

1 回答 1

0
  1. Go to vServers.
  2. Click on the site you want to change.
  3. Click the Behavior tab.
  4. Click Rule Management.
  5. Click the + (plus) button to add a new rule.
  6. Choose Manual and select Full Path rule type.
  7. Type the HTTP path which should be /dir/a.xml and click add.
  8. Go to the Handler tab and select Static Content.
  9. Go to the Transform tab.
  10. Under Header Operations put Content-Type for the header and application/a for the value.

That should do the trick. From there you can save then click on your new rule in the list and click the clone button (beside the add button) and edit it for the other files.

It's a bit tedious but it works. I'm sure it wouldn't be so complicated if you were manually editing the config file but they don't recommend that.

Hope that helps.

于 2012-09-24T18:24:57.193 回答