The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Disallow attachment hotlinking (htaccess)
Another forum has hotlinked an attachment image of my forum.
Here are my htaccess rules. They don't work. Quote:
Could it be that no referer is sent if an attachment image is embedded on a site as an image? But the second check does not allow an empty referer. So either way, the hotlinking image should be shown instead of the attachment... |
#2
|
|||
|
|||
I'm not much of a mod_rewrite person, but could it be that they're not using www?
|
#3
|
|||
|
|||
I'm looking for a solution as well. Tried .htaccess myself, and tried a plugin and hacked attachment.php file from vB.org - none worked. I host video files, so it would suck if someone starts hotlinking them, lol.
|
#5
|
|||
|
|||
Thanks for trying to help, but no change. I can still hotlink my attachments...
|
#6
|
||||
|
||||
Here is what I use and it works fine for me.
Code:
# Hotlink Protection - images RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://(.+\.)?yoursite\.com/ [NC] RewriteRule .*\.(jpe?g|gif|bmp|png|mp3|pdf|psd)$ /forums/images/nohotlinking.jpg [L] # Hotlink Protection - attachments RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://(.+\.)?yoursite\.com/ [NC] RewriteRule .*attachment\.php*$ http://www.yoursite.com/forums/images/nohotlinking.jpg [L,R,NC] |
Благодарность от: | ||
Frosty |
#7
|
|||
|
|||
Doesn't work either... It maybe works for you because you use some sort of a SEO mod or vB4, where attachments end with their own extension, and not with php extension, or you don't allow viewing of attachments to guests. Anyhow, I've pretty much checked every thread on vB.com/vB.org related to attachment hotlinking, and none of the .htaccess snippets, plugins and file hacks aren't working.
|
#8
|
||||
|
||||
No SEO stuff. But I don't allow guests to view attachments. never saw any reason to. I even have it set up where I allow hot-linking from one specific directory and no others.
|
#9
|
|||
|
|||
Well yeah, I do want my guests to be able to view attachments as I host pictures and videos - so having them enabled for guests on my site isn't a problem - as I don't want anyone to sign up because of few pictures, or one video. But I don't want anyone eating up my bandwidth by linking longer videos to their sites either.
|
#10
|
|||
|
|||
Quote:
Some questions/comments about your solution: You match "(.+\.)?". Any referer that will end with ".yoursite.com/" can still hotlink your images. So it's probably better to use "(www\.)?", unless you also want to allow subdomains. Just a theoretical question: Is the dollar sign in the match pattern really needed? Because once the "*" is reached, it will match all the following characters. But I guess you need to tell the pattern where to start the search... I don't know why my solution did not work. Maybe it was the pattern, maybe it was the NC,R,L... |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|