LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 07-04-2005, 07:36 PM   #1
needforspeed
Member
 
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 dating-s.net/umax/sitemap/ 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.

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

Rep: Reputation: 32
I assume you use apache:
http://httpd.apache.org/docs-2.0/mod/mod_access.html

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

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

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


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:12 AM.

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