问题描述
我只是工作的私人页面上的一些视频,这应该只是通过htaccess的访问。所有的视频都HTML5 EN codeD,而网站能正常工作而不htaccess文件每一个浏览器。
i m just working on a private page with some videos, which should only be accessible through htaccess. all videos are html5 encoded, and the site works fine for every browser without the htaccess file.
把htaccess文件到我的服务器后,Safari浏览器无法加载的MP4,视频。查尔斯我得到一个401需要授权。
after putting the htaccess file to my server, safari fails to load the mp4-videos. in charles i get an "401 Authorization Required".
我检查了几个职位在这里同样的话题,但没有找到一个解决办法。如果有人可以把米的正确方向,继续前进!
i checked several posts here to the same topic, but didn't found a solution yet. if someone can push m in the right direction, go ahead!
一些人解决了这个问题,同时加入了MIME类型来htaccess的文件(见下文)。奥斯卡最佳吨为我工作...任何人任何想法?
some people solved this issue, while adding the mime types to the htaccess-file (see below). didn t work for me...anyone any ideas?
在htaccess的根文件夹
htaccess at root folder
AuthUserFile /rootpath/.htpasswd
AuthGroupFile /dev/null
AuthName "Password Protected Area"
AuthType Basic
AddType video/ogg .ogv
AddType video/mp4 .mp4
AddType video/mp4 .mov
AddType video/webm .webm
<limit GET POST>
require valid-user
</limit>
htacess视频文件夹
htacess in video folder
AddType video/ogg .ogv
AddType video/mp4 .mp4
AddType video/mp4 .mov
AddType video/webm .webm
甚至与一些HTML5,例如视频检查,所以couldn T为错误的codeC。请记住,它的工作原理完全没有htaccess文件,所以我想我的配置仍然是错误的。但我不知道在哪里的错误是...
even checked it with some html5-example videos, so couldn t be wrong codec. keep in mind, it works perfect without the htaccess file, so i guess my configuration is still wrong. but i have no idea where the bug is...
推荐答案
尝试使用以下code
Try using below code
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
AddType video/ogg .ogv
AddType video/ogg .ogg
AddType video/mp4 .mp4
AddType video/webm .webm
AddType application/x-shockwave-flash swf
这篇关于Safari浏览器HTML5视频的MP4不是在玩htaccess的文件夹中,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!