Dear friends i want to block a specific domain that is targeting mysite (it has a link in it to mysite) as i can get its webmaster to remove it i want this link when its clicked not to appear my site. I was informed that i can do that by putting an .htaccess in my httpdocs with the code below: order allow,deny deny from site.com allow from all And i do that, but when i go to that site and click the link my site still appears!?!? What should i do? I tried also to put in its ip but it still dont work anybody knows why? Thanks anyway
RewriteEngine on # Options +FollowSymlinks RewriteCond %{HTTP_REFERER} badsite\.com [NC] RewriteRule .* - [F] Code (markup): Edit: source is http://www.javascriptkit.com/howto/htaccess14.shtml
If you are hosted on a linux server add the following link to your .htaccess file: <Limit GET> order allow,deny deny from X.X.X.X </limit> Code (markup): That makes the trick use www.dnsstuff.com to find the IP from site.com or use cpanel for this.
Man i dont know what to do. Ive put this: <Limit GET> order allow,deny deny from site.com </limit> after that this: RewriteEngine on RewriteCond %{HTTP_REFERER} ^http(s)?://(www\.)?site.com.*$ [NC] RewriteRule .* - [F,L] before you post this answers -> but nothing happend!!! I know that because i went to the site.som that i block press my link but my site still appears! Is this a problem in my pc or browser? What do i do wrong i dont know?? Please helpme a bit cause its vital for me to block this site
Should the client that open the page run its machine on Linux in order to work? I use windows xp. I dont know what else to think, every page in the internet has the above two examples to block a domain. Which is the diference anyway?
RewriteEngine on # Options +FollowSymlinks RewriteCond %{HTTP_REFERER} badsite\.com [NC] RewriteRule .* - [F] Code (markup): did not work?
The problem might be that he is using both mod_rewrite and <Limit GET> at the same time. Try one or another, but not both in the same file
You have to set a variable according to the referrer. You can do it like this: # start of htaccess code SetEnvIfNoCase Http_Referer "site.com" bad_link <Limit GET POST> Order Allow,Deny Allow from all Deny from env=bad_link </Limit> # end of htaccess code If you want to add more links to your site that you want to deny, just add additional "SetEnvIfNoCase" lines right after or before the existing one above, but change the part where it says "site.com". Put the actual referring site name there. -Maurice
Works, thanks a lot RewriteEngine on # Options +FollowSymlinks RewriteCond %{HTTP_REFERER} badsite\.com [NC,OR] RewriteCond %{HTTP_REFERER} anotherbadsite\.com RewriteRule .* - [F]
This should be blocking refferer only in any page of the domain. But ill tell you something weird. I thought it didnt work for anyone, but hear this: it works for anybody else exept me how come? I tell a friend of mine to hit the link from the other domain to mine and it told me that a screen appeared that said forbidden, when i tried it i saw the page just fine!! So i told in two more people to check and it said forbidden! So the problem is in my pc, a cookie or something can anybody imagine?