Forum Moderators: phranque
i want to set an htaccess protection on the second website in order to allow connections only from the first website to prevent leeching and hotlink on my second website..
here is my htaccess placed on the second website..
Order Deny,Allow
Deny from all
Allow from www.myfirstwebsite.com
and it doesn't work.. could someone help me?
Welcome to WebmasterWorld
I have not answered, because this is not my forte...
Are you sure you have included LIMIT?
<Limit GET POST>
Order Deny,Allow
Deny from all
Allow from www.myfirstwebsite.com
</Limit>
I believe this can be set to * (all) or individual request types, but again, this is not what I normally work with, so you will probably want to follow up on my suggestion.
Justin
Allow from example.com
If you want to test the referrer, you'll need something like
SetEnvIf Referer "$^" allowit
SetEnvIf Referer "example\.com" allowit
Order Deny,Allow
Deny from all
Allow from allowit
You can also use mod_rewrite -- There are already tons of threads here with mod_rewrite anti-hotlinking code.
Note that blank referrers are specifically allowed by the code above. There are many users whose referrers will be blocked without their knowledge, and you'll need to allow them access unless you have a 24/7 help desk and intendt to allow them one IP address at a time... :o
Watch out! -- The value you need to test is the referrer header. And the corresponding variable name is consistently misspelled in Apache as "referer".
Jim