Please help with a hotlinking issue

Discussion in 'Site & Server Administration' started by carl_in_florida, Jun 16, 2008.

  1. #1
    I have a pdf i posted in a blog post. I now see that lots of people have hotlinked to the article. This is not a marketing issue, it is not a blog I make money on but I want people to download from my link not a hotlink.

    How can I make the pdf available but not allow folks to hotlink within a worpress blog? I don't want to require email signup or anything like that.
     
    carl_in_florida, Jun 16, 2008 IP
  2. Afazelpoor

    Afazelpoor Guest

    Messages:
    292
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Create an .htaccess file on the folder the pdf file is hosted on.
     
    Afazelpoor, Jun 16, 2008 IP
  3. carl_in_florida

    carl_in_florida Active Member

    Messages:
    1,066
    Likes Received:
    63
    Best Answers:
    0
    Trophy Points:
    90
    #3
    an htaccess file doing what?
     
    carl_in_florida, Jun 16, 2008 IP
  4. godsofchaos

    godsofchaos Peon

    Messages:
    2,595
    Likes Received:
    124
    Best Answers:
    0
    Trophy Points:
    0
    #4
    If you are using a cpanel hosting then go to the hotlink menu in cpanel, and activate it. After activating it simply add pdf to the list beside the default jpg gif blah blah default list. And people who hotlinks to you wont steal your content :)
     
    godsofchaos, Jun 16, 2008 IP
  5. mellow-h

    mellow-h Peon

    Messages:
    750
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #5
    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^http://domain.com/.*$      [NC]
    RewriteCond %{HTTP_REFERER} !^http://domain.com$      [NC]
    RewriteCond %{HTTP_REFERER} !^http://www.domain.com/.*$      [NC]
    RewriteCond %{HTTP_REFERER} !^http://www.domain.com$      [NC]
    RewriteRule .*\.(pdf)$ [F]
    
    Code (markup):
    This will result a 403 forbidden request if the user is not from your blog post. You can also redirect the user using the following code:

    
    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^http://domain.com/.*$      [NC]
    RewriteCond %{HTTP_REFERER} !^http://domain.com$      [NC]
    RewriteCond %{HTTP_REFERER} !^http://www.domain.com/.*$      [NC]
    RewriteCond %{HTTP_REFERER} !^http://www.domain.com$      [NC]
    RewriteRule .*\.(pdf)$ http://redirecturl.com [R,NC]
    
    Code (markup):
     
    mellow-h, Jun 17, 2008 IP