Results 1 to 5 of 5

Thread: .htaccess Refferer Question..

  1. #1
    You do realize by 'gay' I mean a man who has sex with other men?
    Join Date
    Oct 2003
    Location
    New Orleans, Louisiana.
    Posts
    21,635

    .htaccess Refferer Question..

    Just wondered if anyone had the proper htaccess coding to only allow hits from a specific domain?

    What i mean is, i only want domain1.com, domain2.com, domain3.com to be able to physically hit site.com

    Regards,

    Lee


  2. #2
    Life is a dick and when itīs get hard---just fuck it... DEVELISH's Avatar
    Join Date
    Jul 2005
    Posts
    2,367
    Quote Originally Posted by Lee
    Just wondered if anyone had the proper htaccess coding to only allow hits from a specific domain?

    What i mean is, i only want domain1.com, domain2.com, domain3.com to be able to physically hit site.com

    Regards,

    Lee
    Hi Lee,

    I do not have specific coding for that but I can imaging using the "anti-hotlinking" for pictures to do what y'all want. Just search for "hotlinking .htaccess" in google

    DEV.


  3. #3
    virgin by request ;) Chilihost's Avatar
    Join Date
    Oct 2003
    Posts
    4,496
    Try this:

    Code:
    {Limit GET}
    order deny,allow  
    deny from all  
    allow from 192.1.2.3  
    allow from 192.1.2.4 
    allow from 192.1.2.5
    Satisfy Any  
    {/Limit}
    replace the { and } with [ and ] plus change it for the right IP addresses.

    Alternatively, you can base it on referrer info
    Code:
    Options +FollowSymLinks
    Options +SymLinksIfOwnerMatch
    
    RewriteEngine on
    
    RewriteCond %{HTTP_REFERER} !^http://www.domain1.com/.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://domain1.com/.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://www.domain2.com/.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://domain2.com/.*$ [NC]
    
    RewriteRule /*$  http://www.goaway.com [L,R]
    repeating the RewriteCond lines for every domain & subdomain you want to allow.

    cheers,
    Luke


  4. #4
    You do realize by 'gay' I mean a man who has sex with other men?
    Join Date
    Oct 2003
    Location
    New Orleans, Louisiana.
    Posts
    21,635
    Awesome stuff thanks guys

    Regards,

    Lee


  5. #5
    Jesus was never married, ran around with twelve guys, and was betrayed by a kiss from another guy. Lippi's Avatar
    Join Date
    Oct 2005
    Location
    Amsterdam
    Posts
    304

    htaccess tools

    Very easy to do with this online tool:

    http://www.htaccesstools.com/hotlink-protection/


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •