1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Hotlink protection help (not xenforo related)

Discussion in 'XenForo Questions and Support' started by Kaiser, Dec 27, 2010.

  1. Kaiser

    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.
     
  2. Brogan

    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.
     
  3. Kaiser

    Kaiser Well-Known Member

  4. Brogan

    Brogan XenForo Moderator Staff Member

    You link using a URL but you can't embed.
     
  5. Kaiser

    Kaiser Well-Known Member

    [​IMG]

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

    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.
     
  7. OperaManiac

    OperaManiac Well-Known Member

    since i can see the image here i would say that hotlink protection is not working on your website!
     
  8. Kaiser

    Kaiser Well-Known Member

    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]
    
     
  9. OperaManiac

    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
     
  10. Kaiser

    Kaiser Well-Known Member

    O really? Good for you. Congratulations!
     
  11. OperaManiac

    OperaManiac Well-Known Member

    you should definitely check out their services. the free package has enough goodies to lure any one!
     
  12. Brogan

    Brogan XenForo Moderator Staff Member

    Try adding RewriteEngine on above the rewrite rules and below the if statement.
    As it is in my post above.
     
    OperaManiac likes this.

Share This Page