这个 htaccess 规则有什么问题?
我发现有人正在复制我的网站,所以我只想用“请勿复制”图像替换他网站上的热链接图像。但后来有些人给我发消息说他们也在我的网站上看到了“请勿复制”图片。以下内容有什么问题吗?
RewriteEngine On
RewriteCond %{HTTP_REFERER} ^http://(.+\.)?example\.net/ [NC]
RewriteRule .*\.(jpe?g|gif|bmp|png)$ http://link/to/image.jpg [L]
I found out some guy was making an exact copy of my website so I wanted to replace the hotlinked images only on his website with a 'don't copy' image. But then some people messaged me saying they were seeing the 'don't copy' image on my website too. Is there anything wrong w/ the following?
RewriteEngine On
RewriteCond %{HTTP_REFERER} ^http://(.+\.)?example\.net/ [NC]
RewriteRule .*\.(jpe?g|gif|bmp|png)$ http://link/to/image.jpg [L]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
“推荐人”是由客户填写的项目。不是每个人都使用它,所以不是每个人都会得到你的形象。
客户端(浏览器)可以将其留空(为了更好的隐私),或者可以用您的网站作为引用来填充它,以伪造行为并仍然获得您的图像。因此,您会得到一些误报(正如您的用户报告的那样),并且也可能会得到一些误报(人们仍在浸出您的图像),尽管您必须专门针对这一点。
The 'referer' is a client-filled item. Not everyone uses it, so not everyone will get your image.
Clients (browsers) can leave it blank (for better privacy), or one can fill it with your site as referer, to fake behaviour and still get your images. So you'll get some false negatives (as your users are reporting) and could get some false positives (people still leaching your images) too, although you'd have to be specially targeted for that.