View Full Version : Can I block an agent by referrer?
hergo
Aug 15th 2004, 11:09 am
Hi all,
This may sound weird, but is there any way to block a user agent by a particular referrer?
For example, can I prevent Google from following an external link into my site without blocking visitors?
The reason for this is that a URL of a redirect has appeared in Googles results for one of my sites.
It has my site cached and all that but when clicked on just redirects over to my site with my URL in the address bar.
Any suggestions are appreciated
Arron
Will.Spencer
Aug 15th 2004, 12:49 pm
You should be able to block certain referrer agents using Apache's MOD Rewrite.
Umm... are 'ya using Apache? ;)
hergo
Aug 15th 2004, 6:56 pm
Yeah im using Apache.
Is there any chance i could get a snippet of code that would work?
Thanks
Will.Spencer
Aug 15th 2004, 8:26 pm
I am no MOD Rewrite guru, but this will only take three commands.
Google for RewriteEngine, RewriteCond and RewriteRule.
Sorvoja
Aug 15th 2004, 10:39 pm
You can not block Google by the referer since Googlebot dosn't have a refering address.
hergo
Aug 16th 2004, 12:39 am
Yeah your right. I didnt think about that. Come to think of it my logs dont even show a referring address when the link is clicked on, they do for most links but not this one. This also means i have no idea how much traffic this link is generating (if any).
But if there is no referring address in my log files, can i still block access from this referrer?
If not, any other ideas on how i could get this link off of the search engines?
Particularly Google as it seems to be causing a duplicate content issue.
Will.Spencer
Aug 17th 2004, 8:21 am
Err... it appears that I am getting my terminology all jumbled up.
You can block by user agent, and Googlebot does have one of those!
Sorry. <blush>
hergo
Aug 17th 2004, 9:18 am
All's good.
I've got doubts on whether i can do this though.
It may just be one of those things i'll have to learn to live with.
The only thing i can think of is blocking access completely from that link. Singling out Google sounds tricky but id be happy to know how to do it though.
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.