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 on same server

Discussion in 'General Discussion' started by bsasninja, Mar 13, 2008.

  1. bsasninja

    bsasninja Well-Known Member

    Joined:
    Sep 2, 2004
    Messages:
    528
    Likes Received:
    0
    Trophy Points:
    16
    I have some asx files of audio. And I dont want that others copy the links to that files and use them in other servers.

    But if enable hotlink protection, what happens If I use the link in a machine on the same server? will be blocked to? Is there a way to whitelist the local server?

    Thanks
     
  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
    If I understand you correctly, you have your files say on domain1.com but you are going to be hotlinking to them from domain2.com which is hosted on the same server, correct?

    Hotlink protection will allow domain1.com to hotlink to the files, but not domain2.com even though it is on the same server.
     
  3. bsasninja

    bsasninja Well-Known Member

    Joined:
    Sep 2, 2004
    Messages:
    528
    Likes Received:
    0
    Trophy Points:
    16
    I figured out, but I still have issues:

    On domain1.com I have a .pls file inside a folder.
    I created a hotlink protection on domain1.com that allow access to domain2.com too. So the allowed domains to access .pls files are domain1.com and domain2.com.

    If you copy the link, for example in domain3.com the access wont be allowed, and you will be redirected to a denied.html page.

    But the issue is here. On domain1.com I have a login, when you login in redirects you to the folder where the .pls files are stored. But I´m being redirected to the denied.html, Im dizzy cause domain1.com is allowed and I dont know the reason of why is refusing the http referer.

    Here is the .htaccess

    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^http://domain1.com/.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://www.domain1.com/$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://domain1.com/folder/.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://www.domain1.com/folder/$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://domain2.com/.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://www.domain2.com/$ [NC]
    RewriteRule .*\.(pls)$ http://www.domain1.com/denied.html

    Correct me if i´m doing something wrong.

    Thank you!
     
Loading...

Share This Page