禁用从用户浏览器直接链接到我的文件
我使用以下 .htaccess
配置来禁用热链接:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)mywesbite.com/.*$ [NC]
RewriteRule \.(flv|mp4|pdf|xls|doc|mov|wmv|avi)$ http://www.mywebsite.com/images/logo.jpg [R,L]
我已经测试过它,一切工作正常,现在我想在用户尝试将其中一个文件的直接链接添加到浏览器的地址栏时禁用下载文件。 只有从我的网站引用该文件的用户可以下载该文件。有什么方法可以通过添加更多 .htaccess
配置来完成此操作吗?
I'm using the following .htaccess
configurations to disable hotlinking :
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)mywesbite.com/.*$ [NC]
RewriteRule \.(flv|mp4|pdf|xls|doc|mov|wmv|avi)$ http://www.mywebsite.com/images/logo.jpg [R,L]
And I've tested it and everything is working fine, and now I want to disable downloading the files when the user tries to add the direct link of one of the files to his browser's address bar. Only the users that are referred to the file from my website can download it. Is there any way I can get that done by adding some more .htaccess
configurations?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果这不起作用的话,可以选择
Alternative if that doesnt work