Solved

Blocking access to my website by host name

Posted on 2014-12-16
3
462 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction As you’re probably aware the HTTP protocol offers basic / weak authentication, which in combination with the relevant configuration on your web server, provides the ability to password protect all or part of your host.  If you were not…
Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

911 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now