htaccess?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • strongdong
    Confirmed User
    • Sep 2003
    • 191

    #1

    htaccess?

    I want to allow hotlinking for some domains but block hotlinking for all others for .flv files...anyone know how to do this? antihotlinking.com does not seem to work
  • AdPatron
    No commissions, no fees.
    • Apr 2003
    • 17706

    #2
    First you need to make sure apache (if you're on a linux server) was configured with RewriteEngine on. If it is, then do a search on google for RewriteEngine and you'll get tons of info on how to stop hotlinking.

    Comment

    • draude
      Confirmed User
      • Nov 2006
      • 1214

      #3
      try this one -> http://www.javascriptkit.com/howto/htaccess10.shtml
      Web Developer

      Comment

      • V_RocKs
        Damn Right I Kiss Ass!
        • Nov 2003
        • 32449

        #4
        Depends on are you going to have a white list or a black list?


        In any case, here is mine:

        Code:
        RewriteEngine on
        RewriteCond %{HTTP_REFERER} !^$
        RewriteCond %{HTTP_REFERER} !^http://(www\.)?rhinosthumbs.com(/)?.*$     [NC]
        RewriteCond %{HTTP_REFERER} !^http://(www\.)?rhinoslinks.com(/)?.*$     [NC]
        RewriteCond %{HTTP_REFERER} !^http://(www\.)?americastgp.com(/)?.*$     [NC]
        RewriteCond %{HTTP_REFERER} !^http://(www\.)?gofuckyourself.com(/)?.*$     [NC]
        RewriteCond %{HTTP_REFERER} !^http://(.+)?yahoo.(.+)(/)?.*$     [NC]
        RewriteCond %{HTTP_REFERER} !^http://(.+)?google.(.+)(/)?.*$     [NC]
        
        RewriteRule .*\.(flv)$ - [F,NC]
        Notice mine is a white list of allowed sites.

        Comment

        • strongdong
          Confirmed User
          • Sep 2003
          • 191

          #5
          Originally posted by V_RocKs
          Depends on are you going to have a white list or a black list?


          In any case, here is mine:

          Code:
          RewriteEngine on
          RewriteCond %{HTTP_REFERER} !^$
          RewriteCond %{HTTP_REFERER} !^http://(www\.)?rhinosthumbs.com(/)?.*$     [NC]
          RewriteCond %{HTTP_REFERER} !^http://(www\.)?rhinoslinks.com(/)?.*$     [NC]
          RewriteCond %{HTTP_REFERER} !^http://(www\.)?americastgp.com(/)?.*$     [NC]
          RewriteCond %{HTTP_REFERER} !^http://(www\.)?gofuckyourself.com(/)?.*$     [NC]
          RewriteCond %{HTTP_REFERER} !^http://(.+)?yahoo.(.+)(/)?.*$     [NC]
          RewriteCond %{HTTP_REFERER} !^http://(.+)?google.(.+)(/)?.*$     [NC]
          
          RewriteRule .*\.(flv)$ - [F,NC]
          Notice mine is a white list of allowed sites.
          so this allows hotlinking from those sites, but disallows it for all others?

          Comment

          • ne0
            Confirmed User
            • May 2006
            • 781

            #6
            Originally posted by strongdong
            so this allows hotlinking from those sites, but disallows it for all others?
            yes, but it will allow blank referrers too.
            this line:
            Code:
            RewriteCond %{HTTP_REFERER} !^$
            if you want to disable any access to it that is not from your domain you should consider removing that too. But note that there are some anti-viruses that will clean up the referrer, not a lot, but could cause your image not to show up for a handful of people.
            hai2u

            Comment

            Working...