Hotlink protection help (not xenforo related)

Kaiser

Well-known member
Is it better to have it on or off? Or it really dosent matter? Currently I have it turned on. I have a question, like say my avatar I have it uploaded on my forum, I link to it and put it on my avatar on other forums (http://adminbb.org/data/avatars/l/0/1.jpg) Shouldnt hotlinking disable this so I cant use use it on other forums?

Thanks in advance.
 

Brogan

XenForo moderator
Staff member
If you enable hotlink protection, then any files with the extensions you specify, won't be able to be embedded on other sites/domains.

You can optionally specify an image to replace any embedded images.

As to whether it's better on or off, that's a personal preference and largely depends on your content and how much bandwidth is utilised by other sites embedding images.
 

Kaiser

Well-known member


Im still c0nfused, im embedding the pic above from my site into the post. Isnt that hotlinking though?
 

Brogan

XenForo moderator
Staff member
It is.
Check the .htaccess file in your domain root.
It should contain something like this:

Code:
RewriteEngine on

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://adminbb.org/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://adminbb.org$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.adminbb.org/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.adminbb.org$ [NC]
RewriteRule .*\.(jpeg|gif|bmp|png|jpg)$ hotlinking.jpg [L]
The last line is where you specify the file extensions and an image to display in place of any embedded files.
 

Kaiser

Well-known member
It is.
Check the .htaccess file in your domain root.
It should contain something like this:

Code:
RewriteEngine on

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://adminbb.org/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://adminbb.org$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.adminbb.org/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.adminbb.org$ [NC]
RewriteRule .*\.(jpeg|gif|bmp|png|jpg)$ hotlinking.jpg [L]
The last line is where you specify the file extensions and an image to display in place of any embedded files.
I have it but still not working?
What my .htacess has
Code:
<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^.*$ - [NC,L]
    RewriteRule ^(data|js|styles|install) - [NC,L]
    RewriteRule ^.*$ index.php [NC,L]
</IfModule>

RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [F,NC]

RewriteCond %{HTTP_REFERER} !^http://adminbb.org/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://adminbb.org$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.adminbb.org/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.adminbb.org$      [NC]
RewriteRule .*\.(zip|txt|pdf|png|jpg|jpeg|jpe|gif|rar)$ - [F,NC]
 

OperaManiac

Well-known member
sort of off-topic but i have been using the hotlink feature provided by cloudflare on my own site. works great. :p
 
Top