Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 07-04-2005, 07:36 PM   #1
Registered: Aug 2003
Distribution: Gentoo
Posts: 73

Rep: Reputation: 15
How do I block referrers that are linking to my server?

I am getting quite a few hits to my site from referrers that shouldn't be directing people to me, looks like spam sites or something, I can't even find a link or anything to me on them. Most of them are originating from or something from the same domain. The hits from these referrers never go past the index.php page

I googled and found out that I can put some lines in my .htaccess file and it would either give users from that referrer a 403 error, or I can have it redirect them to notice.html which will notify the person browsing that they were referred by that site and to check for spyware and whatnot. (Seems to me like it's people who have spyware/adware that are getting redirected to my site somehow)

Anyway, the .htaccess file doesn't seem to be stopping them, as my index.php writes it's own log file that has referrer info in it, and these things are still getting through. Seems like it's mostly the same IP doing this also.

Is there any other way to stop this? Can somebody tell me what exactly is going on with these referrers? I can post portions of the log file if necessary.

Old 07-05-2005, 08:01 PM   #2
Registered: Jun 2005
Location: Canada
Distribution: Debian Etch/Sid, Ubuntu
Posts: 529

Rep: Reputation: 32
I assume you use apache:

SetEnvIf Referer ^yourwebsiteregexp let_me_in
<Directory />
Order Deny,Allow
Deny from all
Allow from env=let_me_in

SetEnvIf Referer ^badguyregexp get_out
<Directory />
Order Allow,Deny
Allow from all
Deny from env=get_out

Last edited by stefan_nicolau; 07-05-2005 at 08:03 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Linking a file on disk to a fake block device? fyhuang Linux - Software 2 10-31-2005 07:23 AM
Remote office can't connect to Redhat 7.3 server using new IP block from ISP Poseiden Linux - Networking 2 04-14-2005 08:56 AM
How to block/turn off referrers in SuSE 9.1 HenchmenResourc Linux - Security 1 08-14-2004 09:24 PM
Is that a good thing to block ICMP protocol on a Web server? Iced Earth Linux - Security 2 06-15-2004 06:49 AM
block msn into the debian server eduac Linux - Software 1 07-17-2003 10:53 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:22 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration