使用防盗链
我想知道如何在以下代码中定位图片:
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://dooomain.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.dooomain.com/.*$ [NC]
RewriteRule .*.jpg$ - [L]
不太确定必须在哪里插入 jpg 文件!它是在网络根文件夹中还是在哪里?
谢谢
更新#1
好吧,也许我找到了一些答案,但不确定,所以如果我错了,请大家纠正我...
这是我应该添加的代码,而不是最后一行我的主要帖子:
RewriteRule \.(gif|jpg)$ https://www.mydooomain.com/pic.gif [R,L]
在这种情况下我需要将图片放在根目录中,对吗???
谢谢
I'm wondering how to target the picture in this following code:
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://dooomain.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.dooomain.com/.*$ [NC]
RewriteRule .*.jpg$ - [L]
not really sure where I have to insert the jpg file!! is it in the web root folder or where?
Thanks
Update #1
ok, maybe I found something to my answer, but not sure so please guys correct me if I'm wrong...
here is the code I should add instead of the last line in my main post:
RewriteRule \.(gif|jpg)$ https://www.mydooomain.com/pic.gif [R,L]
and I need to place the picture in the root in this case, is that right???
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
上面的最后一条规则很好。但是 rewritecond 可以在一行中完成。
The last rule above is fine. But
rewritecond
can be done in a single line.