Apache 没有为 .manifest HTML5 脱机文件分配正确的 MIME 类型
我正在运行 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要在 Apache 中提供 appcache mime-type“并且 Xampp 是 apache 内部”,请将此行添加到您的配置文件中: mime.types
到您的文件 mime.types 中
To serve appcache mime-type in Apache "and Xampp is apache inside", add this line to your config file: mime.types
into your file mime.types located