• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 491
  • Last Modified:

Blocking access to my website by host name

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
ddantes
Asked:
ddantes
  • 2
1 Solution
 
GaryCommented:
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
 
ddantesAuthor Commented:
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
 
GaryCommented:
It returns a 403 Forbidden message - i.e. you are not allowed here.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now