仅对一个目录进行盗链保护

发布于 2024-10-07 10:53:21 字数 257 浏览 0 评论 0原文

我只想阻止对一个目录的访问,例如 http://www.example.com/pictures 其他目录中的每个文件都应该正常可用。

我已经完成了推荐人检查解决方案。这很容易被绕过。

我只是想在页面上显示图片目录中的图像,例如 view.php 如果从其他地方访问此目录中的图像。只需重定向到一张显示不允许盗链的图像即可”

谢谢

I want to block access to only one directory say http://www.example.com/pictures
Every file in other directory should be available as normal.

I have gone through a referrer checking solution. That can be easily bypassed.

I Simply want to show images in pictures directory on a page say view.php
if images in this directory accessed from anywhere else. Just redirect to an image that says hotlinking not allowed"

Thanks

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

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

发布评论

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

评论(1

抹茶夏天i‖ 2024-10-14 10:53:21

我已经完成了推荐人检查解决方案。这很容易被绕过。

是的,可以。但任何防盗链方案也可以。它会阻止随意/粗心的使用,但仅此而已。

就其价值而言,推荐人检查几乎是做到这一点的方法。

I have gone through a referrer checking solution. That can be easily bypassed.

Yes, it can. But so can any hotlink-prevention scheme. It'll deter casual/careless use, but that's about it.

For what it's worth, referrer-checking is pretty much the way to do it.

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