Need some assitance with an .htaccess that allows ALL subdomains

Discussion in 'Apache' started by webtracker, May 5, 2009.

  1. #1
    I need a little help with the following. Just a few people to confirm that this will disallow ALL hotlinking to my site but allow hotlinking from the few that I list, including ALL of their subdomains.
    
    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER}  !^http://([^.]+\.)?allowedsite1.com\. [NC]
    RewriteCond %{HTTP_REFERER}  !^http://([^.]+\.)?allowedsite2.com\. [NC]
    RewriteRule \.(jpg|jpeg|png|gif|bmp)$ http://donothotlink.jpg [NC,R,L]
    Code (markup):
    Again, I need to make sure that all sites be blocked from hotlinking to my site and that allowedsite1.com and allowedsite2.com, including any of their subdomains, be ALLOWED to hotlink.

    That's it.

    Thanks in advance for any help.
     
    webtracker, May 5, 2009 IP
  2. 123addme

    123addme Active Member

    Messages:
    171
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    58
    #2
    try this code

    RewriteCond %{HTTP_REFERER} !^http://(*\.)?allowedsite1.com/.*$ [NC,OR]
    Code (markup):
     
    123addme, May 6, 2009 IP