The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Hotlink Protection not working

Discussion in 'General Discussion' started by mackchad, Mar 10, 2008.

  1. mackchad

    mackchad Registered
    PartnerNOC

    Joined:
    Mar 10, 2008
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    I have a customer who is trying to use the Hotlink Protection feature but it is not working. I have setup a test site that has hotlinked a gif image from my customer's site. Hotlink Protection is enabled in cPanel and gif is listed as an allowed extension. Can someone give me some pointers on what maybe causing the problem?
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Just to cover all bases here: the wording of this feature is notoriously confusing. By "allowed" it means what extensions are allowed to be blocked by Hotlink Protection. Therefore the intended behavior when "gif" is listed as an allowed extension is to block all hotlinking of .gif files. If that is not what is happening, then yes, there is a problem and it should be investigated.
     
  3. ToddShipway

    ToddShipway Well-Known Member

    Joined:
    Nov 13, 2006
    Messages:
    300
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Houston, TX
    If hotlinking is enabled for gif images as David stated above and you are able to hotlink the image, the problem is most likely due to rules within .htaccess. Most, if not all problems with hotlinking are due to custom settings in .htaccess that is causing the hotlink rules to be missed.
     
  4. mackchad

    mackchad Registered
    PartnerNOC

    Joined:
    Mar 10, 2008
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Thanks guys, and yes Hotlink Protection is enabled and I am able to hotlink to a gif image from a test site. Here is the the .htaccess file as I have no idea what could be causing the problem and hopefully someone could point me in the right direction. Thanks in advance.



    RewriteEngine on

    RewriteCond %{HTTP_REFERER} !^http://canadascience.com/.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://canadascience.com$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://www.canadascience.com/.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://www.canadascience.com$ [NC]
    RewriteRule .*\.(jpg|jpeg|gif|png|bmp|mp3)$ - [F,NC]
     
Loading...

Share This Page