?
Solved

Blocking access to my website by host name

Posted on 2014-12-16
3
Medium Priority
?
487 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 58

Accepted Solution

by:
Gary earned 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses
Course of the Month14 days, 10 hours left to enroll

771 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