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
Printable View
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,Quote:
Originally Posted by 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.
Try this:
replace the { and } with [ and ] plus change it for the right IP addresses.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}
Alternatively, you can base it on referrer info
repeating the RewriteCond lines for every domain & subdomain you want to allow.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]
cheers,
Luke
Awesome stuff thanks guys :)
Regards,
Lee
Very easy to do with this online tool:
http://www.htaccesstools.com/hotlink-protection/