Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

A client of mine is receiving traffic from domain names which he wants to stop. The trouble I have is that they are using a 301 redirect which our server is just seeing as a normal web hit from the visitor. No referer is picked up in the logs either so blocking them via the relatively normal method of mod_rewrite won't work. Nor will blocking the hosting servers IP as again, the traffic in Apache is showing as coming from a standard visitor.

Is there any other way of blocking this sort of traffic?

Example Apache output for a visit which has been 301'd from another domain:

my_ip_here - - [09/Jun/2011:18:01:49 +0100] "GET / HTTP/1.0" 200 14012 "-" "Wget/1.12 (linux-gnu)"

share|improve this question
    
How do you know it's due to a 301? From that log entry, I can't tell that. I did notice it's wget, which is a bit odd? –  Kyle Smith Jun 9 '11 at 17:14
    
Do you know why they are 301-ing to your site? For example, most URL shortening services use 301 redirects so by blocking all 301 redirects might wall out valid visitors –  sam Jun 9 '11 at 18:00
    
The wget request was me, which allowed me to trail what each server was doing a little easier :) –  foxed Jun 9 '11 at 19:34

1 Answer 1

The answer from http://www.webmasterworld.com/forum92/2261.htm worked for me:

<Limit GET PUT POST>
order allow,deny
allow from all
deny from .offendersite.net
</Limit>

RewriteEngine on
RewriteCond %{HTTP_REFERER} ^http://(www\.)?offendersite.net/.*$
RewriteCond %{REQUEST_URI} ^/.*$
RewriteRule ^.* - [F] 
share|improve this answer
    
From the OP: "No referer is picked up in the logs either so blocking them via the relatively normal method of mod_rewrite won't work." –  wfaulk May 8 '12 at 1:06

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.