Solved

Blocking access to my website by host name

Posted on 2014-12-16
3
467 Views
Last Modified: 2014-12-16
Lately I've been getting visits to my website, originating from a known spam site (7makemoneyonline.com).  I'd like to prevent that referrer from accessing my site.  I believe they may change IP address from time to time, so I'd prefer to block the host name with .htaccess    My server apparently uses Apache 2.2.22.  Please advise.
0
Comment
Question by:ddantes
  • 2
3 Comments
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 40503953
This assumes they are sending the referer in the headers, if they aren't then you have to use the IP - I doubt they would be constantly changing it.

RewriteEngine on
RewriteCond %{HTTP_REFERER} 7makemoneyonline\.com [NC]
RewriteRule .* - [F]

Open in new window

0
 

Author Comment

by:ddantes
ID: 40503964
Thanks Gary.  I believe they are sending the referrer in the headers, because it is appearing in my server log.   What function does ".* - [F]" accomplish?  For example, does the visitor get a message that access is denied?
0
 
LVL 58

Expert Comment

by:Gary
ID: 40503971
It returns a 403 Forbidden message - i.e. you are not allowed here.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting http://domain.com (http://domain.com) to http…
In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question