The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Attachment.php hotlinking
How can I keep people from hotlinking to attachments? I already stop hotlinks for images. I cannot simply add php to the set since it will prevent people from linking to our article which are php as well.
Any ideas how to keep attachment.php specifically from being hotlinking from outside the domain? I figured it out... here is the code I used in .htaccess to prevent hotlinking for attachment.php and avatar.php Code:
<FilesMatch "attachment\.php"> ErrorDocument 403 http://mydomain.com/sorry.gif SetEnvIf Referer "^http://www\.pimprig\.com" good_referal SetEnvIf Referer "^http://pimprig\.com" good_referal SetEnvIf Referer "^http://forums\.pimprig\.com" good_referal SetEnvIf Referer "^http://gallery\.pimprig\.com" good_referal SetEnvIf Referer "^http://links\.pimprig\.com" good_referal SetEnvIf Referer "^http://reviews\.pimprig\.com" good_referal SetEnvIf Referer "^http://guides\.pimprig\.com" good_referal SetEnvIf Referer "^http://systems\.pimprig\.com" good_referal SetEnvIf Referer "^http://articles\.pimprig\.com" good_referal SetEnvIf Referer "^http://news\.pimprig\.com" good_referal SetEnvIf Referer "^http://team\.pimprig\.com" good_referal SetEnvIf Referer "^$" good_referal Order Deny,Allow Deny from all Allow from env=good_referal </FilesMatch> <FilesMatch "avatar\.php"> ErrorDocument 403 http://mydomain.com/sorry.gif SetEnvIf Referer "^http://www\.pimprig\.com" good_referal SetEnvIf Referer "^http://pimprig\.com" good_referal SetEnvIf Referer "^http://forums\.pimprig\.com" good_referal SetEnvIf Referer "^http://gallery\.pimprig\.com" good_referal SetEnvIf Referer "^http://links\.pimprig\.com" good_referal SetEnvIf Referer "^http://reviews\.pimprig\.com" good_referal SetEnvIf Referer "^http://guides\.pimprig\.com" good_referal SetEnvIf Referer "^http://systems\.pimprig\.com" good_referal SetEnvIf Referer "^http://articles\.pimprig\.com" good_referal SetEnvIf Referer "^http://news\.pimprig\.com" good_referal SetEnvIf Referer "^http://team\.pimprig\.com" good_referal SetEnvIf Referer "^$" good_referal Order Deny,Allow Deny from all Allow from env=good_referal </FilesMatch> |
#2
|
|||
|
|||
Looks interesting, but a little confused. how would this affect the existing htaccess, could you just add this with the other code? Other question is I'm pretty new to this type of code, and I don't use subdomains, so would my code be instead of this:
Code:
SetEnvIf Referer "^http://forums\.pimprig\.com" good_referal Code:
SetEnvIf Referer "^http://www\.pimprig\.com\.forums" good_referal SetEnvIf Referer "^http://pimprig\.com\.forums" good_referal |
#3
|
|||
|
|||
Maybe just turn off attachments for guests?
|
#4
|
||||
|
||||
Quote:
|
#5
|
|||
|
|||
Quote:
|
#6
|
||||
|
||||
Quote:
|
#7
|
|||
|
|||
It should work fine with yoru other .htaccess code. Just add this at the bottom.
If you dont haev subdomains just delete the lines you dont need and change "pimprig" to your own subdomain. |
#8
|
|||
|
|||
is this placed in the root or in the forum folder where the php files are? This is onething I was never sure on.
|
#9
|
|||
|
|||
YOu can place it in the root web folder or the forums folder. Try it one way then test to make sure it's working.
|
#10
|
|||
|
|||
Would someone be so kind as to point out where I would place the code above. This is what my current htaccess looks like:
Code:
Options ExecCGI FollowSymLinks Includes DirectoryIndex index.php index.htm index.html AddHandler cgi-script .cgi AddType application/x-httpd-cgi .cgi <Limit GET> order allow,deny allow from all deny from xxx.xxx.xx.x deny from xxx.xxx.xx.xx [/limit] |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|