anti image hotlinking in .htaccess

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Zester
    Confirmed User
    • Jul 2003
    • 5344

    #1

    anti image hotlinking in .htaccess

    I usally use the following to prevent image hotlinking from my entire site:

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

    how to modify the above if I want to allow image hotlinking for a certain folder, lets say:
    mydomain.com/hotimages/
    * Mainstream ? $65 per sale
    * new male contraception
  • MickeyG
    Confirmed User
    • May 2004
    • 4134

    #2
    use another .htaccess file in that folder

    Comment

    • mikeyddddd
      Viva la vulva!
      • Mar 2003
      • 16557

      #3
      Originally posted by Zester
      I usally use the following to prevent image hotlinking from my entire site:

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

      how to modify the above if I want to allow image hotlinking for a certain folder, lets say:
      mydomain.com/hotimages/
      Only put it where you want it:
      mydomain.com/hotimages/

      RewriteCond %{HTTP_REFERER} !^$
      lets someone key in the URL

      Comment

      • Zester
        Confirmed User
        • Jul 2003
        • 5344

        #4
        I remember now.
        there is 1 work I should in the .htaccess in the folder I want to allow hotlinking in , what was it?
        * Mainstream ? $65 per sale
        * new male contraception

        Comment

        Working...