Apache 没有为 .manifest HTML5 脱机文件分配正确的 MIME 类型

发布于 2024-12-20 23:14:08 字数 832 浏览 3 评论 0原文

我正在运行 XAMPP apache Web 服务器并开发 HTML5 项目,但 Web 服务器没有为 .manifest 文件“分配”正确的 MIME 类型。

如果用户访问我的 HTML5 Web 应用程序并尝试离线使用它,它将失败,因为我的 Web 服务器没有为我的应用程序的 .manifest 文件分配正确的 MIME 类型。

我的问题是:是否需要在 Apache Web 服务器中设置配置,以便分配“text/cache-manifest”MIME 类型?

已经在我的网络服务器根目录 c:/xampp/htdocs/.htaccess 中找到的 .htaccess 文件中尝试了此更改 - 这是根目录中的整个 .htaccess 文件内容我的网络服务器位于 c:/xampp/htdocs,我在此处添加了最后两行,并且我的 .manifest 文件和(如果我更改它)扩展名为 .appcache 的文件都不会被我的网络应用程序的访问者访问,因为我的网络服务器仍未将 MIME 类型分配给正确的“text/cache-manifest”类型:

 AuthType Basic
 AuthName "FORBIDDEN AREA"
 AuthUserfile "../htdocs/forbidden/.htpasswd"
 Require valid-user

 AddType text/cache-manifest .manifest
 AddType text/cache-manifest .appcache

我的 XAMPP Web 服务器中是否还有其他内容需要设置,以便.manifest 或 .appcache 文件被分配了正确的“text/cache-manifest”MIME 类型?

I'm running XAMPP apache web server and developing an HTML5 project and the .manifest file is not being 'assigned' the correct MIME type by the web server.

If a user accesses my HTML5 web app and tries to use it offline it will fail because my web server is not assigning the correct MIME type for my app's .manifest file.

Here is my question: is there a configuration I need to set in my Apache web server so that the "text/cache-manifest" MIME type is assigned?

I have already tried this change in my .htaccess file found in the root of my web server, c:/xampp/htdocs/.htaccess -- this is the entire .htaccess file's contents in the root of my web server at c:/xampp/htdocs, and I added the last 2 lines here, and neither my .manifest file nor (if I change it) a file with the extension .appcache is going to be accessed by a visitor to my web app, because the MIME type is still not being assigned by my web server to the correct type of "text/cache-manifest":

 AuthType Basic
 AuthName "FORBIDDEN AREA"
 AuthUserfile "../htdocs/forbidden/.htpasswd"
 Require valid-user

 AddType text/cache-manifest .manifest
 AddType text/cache-manifest .appcache

Is there something else in my XAMPP web server I need to set so that the .manifest or .appcache file gets assigned the correct "text/cache-manifest" MIME type?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

彩虹直至黑白 2024-12-27 23:14:08

要在 Apache 中提供 appcache mime-type“并且 Xampp 是 apache 内部”,请将此行添加到您的配置文件中: mime.types

text/cache-manifest             appcache

到您的文件 mime.types 中

xampp\apache\conf\mime.types

To serve appcache mime-type in Apache "and Xampp is apache inside", add this line to your config file: mime.types

text/cache-manifest             appcache

into your file mime.types located

xampp\apache\conf\mime.types
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文