Forum Moderators: phranque

Message Too Old, No Replies

How 2 block a link going to my site from an unwanted (porn) site

Blocking a link

         

bartainer

4:12 pm on Oct 20, 2007 (gmt 0)

10+ Year Member



Hello,

There is a link from a porn site going to my friendly site and I'd like it blocked. How do I accomplish this goal on my end.

jd01

7:27 pm on Oct 20, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I guess you could based on referrer using mod_rewrite.

RewriteEngine on
RewriteCond %{HTTP_REFERER} ^(www\.)?badsite\.com
RewriteRule - [F]

Justin

bartainer

9:42 pm on Oct 20, 2007 (gmt 0)

10+ Year Member



Sorry, that's gibberish to me. :) Layman's terms please.

Thanks.

jd01

10:22 pm on Oct 20, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That's about as simple as it gets other than to ask to have the link removed.

What it does is says, "The site is 'forbiden'", to a visitor attempting to access your site from the site you want to restrict access from.

You will need to make sure mod_rewrite is enabled, change badsite to the actual site name and upload the code above to your .htaccess file.

Please, keep in mind this will have no effect on search engines, because they do not send a referrer header, so the link will still be counted.

Not much else you can do.

Justin

bartainer

10:31 pm on Oct 20, 2007 (gmt 0)

10+ Year Member



Ok, thanks.