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.

need help with hotlink

Discussion in 'General Discussion' started by albertldee, Jun 19, 2003.

  1. albertldee

    albertldee Member

    Joined:
    May 10, 2003
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    i put the .htccess file i created in the directory it block jpg, jpeg, gif extension but it doesn't block wmv or asf extension/video
    this is what i have

    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?mysite.com(/)?.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?mysite.com/forums(/)?.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?friendsite.com(/)?.*$ [NC]
    RewriteRule .*\.(gif|jpg|jpeg|bmp|wmv|asf|mpg)$ - [F,NC]

    cPanel.net Support Ticket Number:
     
  2. albertldee

    albertldee Member

    Joined:
    May 10, 2003
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    does anyone have any idea how i can fix it

    cPanel.net Support Ticket Number:
     
  3. newfield

    newfield Active Member

    Joined:
    Mar 2, 2002
    Messages:
    38
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    State of Confusion
    Try removing the minus sign in your RewriteRule:
    change the last line:

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

    to this:
    RewriteRule .*\.(gif|jpg|jpeg|bmp|wmv|asf|mpg)$ [F,NC]

    It's a stab in the darkorb, but, I don't recall any parameters for the minus sign where you have it.

    http://www.apacheref.com/ref/mod_rewrite/RewriteRule.html

    cPanel.net Support Ticket Number:
     
  4. Crazy Pete

    Crazy Pete Well-Known Member

    Joined:
    May 16, 2003
    Messages:
    55
    Likes Received:
    0
    Trophy Points:
    6
    If you mean people can just put the direct url to a video file and download it, it's because you have this line in there...

    RewriteCond %{HTTP_REFERER} !^$

    That line allows blank referrer headers, which is what happens when someone types in a direct link, or has them disabled via their browser or some sort of firewall. I have them disabled because I don't want direct links to go through at all, and if people have a firewall or whatnot I just tell them how to enable referrer headers being sent.

    If you remove that line I bet it'll work the way you're thinking it should.

    cPanel.net Support Ticket Number:
     
  5. albertldee

    albertldee Member

    Joined:
    May 10, 2003
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    thanks everyone
    by the way i'm albert

    i try all the info above and they work in one area but not the other which is embeded

    i have a small board like this and with the video embeded in the post

    <embed src="http://mysite.com/instructionvideo.wmv" autostart="false" controls="true" loop="false" width="320" height="280"></embed>

    they hotlink the my video by embeding it in their forum once you click on play 2 time it will begin playing, how can i stop that

    otherwise everything else work fine
    thanks everyone

    cPanel.net Support Ticket Number:
     
  6. Website Rob

    Website Rob Well-Known Member

    Joined:
    Mar 23, 2002
    Messages:
    1,506
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    Alberta, Canada
    cPanel Access Level:
    Root Administrator
    I think it's more to do with the coding itself. I have seen others have problems as well, when using:

    RewriteCond %{HTTP_REFERER} !^http://(www\.)?mysite.com(/)?.*$ [NC]

    Keep it simple and use:

    RewriteCond %{HTTP_REFERER} !^http://mysite.com.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://www.mysite.com.*$ [NC]

    Sure, you use two lines instead of one, but I'll bet (any flavour of doughnut) the problem goes away. ;)


    Also, with regards to the last line, although the dash is not usually a problem, I recommend using [F,L] instead. As you already know, whether you use Upper or Lower case for your file extensions, using NC is not necessary.
     
    #7 Website Rob, Jun 22, 2003
    Last edited: Jun 22, 2003
Loading...

Share This Page