homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

How to block a referrer from linking to your site?

Msg#: 4278976 posted 5:36 pm on Mar 9, 2011 (gmt 0)

Hello webmasters,

While recently checking my webstats, I noticed a hit from clon.in upon investigating the site, it gives me the creeps.

In a nutshell that stupid site basically hides the referring URL.. something i'm not comfortable with.

Is there a way to set up some kind of script or in my .htaccess where any incoming link from clon.in can be served a 'nice message' from my end or a warning?


P.S: My WP site got hacked recently, it was a PR3, had a 2% bounce rate.. well long story short, the bounce rate increased tremendously along with a few other things.. so yeh, i'm trying to be safe than sorry and not quite in a mood to encourage any 'smart a##es' out there trying to pull a fast one.

Appreciate your responses.



WebmasterWorld Senior Member 10+ Year Member

Msg#: 4278976 posted 9:18 pm on Mar 10, 2011 (gmt 0)

Just a friendly heads up, I don't think you're supposed to call out URL's like that at webmasterworld.

Check out
$_SERVER['HTTP_REFERER']. Log that info to a file, and see if the site you don't want to link to you shows up there. Not sure it will, since you are saying they hide the referring URL. But your webstats must be identifying the referer somehow, so maybe there will be enough info there.

If you find a identifying string in the referer, you can block either in your PHP app or in .htaccess. Googling '.htaccess block by referer' will turn up good instructions for that.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved