[Wolves] one for you apache experts
Baza
baza at themauvezone.fsnet.co.uk
Mon Mar 27 15:11:54 BST 2006
On 27 Mar 2006, at 09:39, Simon Morris wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Baza wrote:
>> OK, here's my problem. Someone has put a link to my blog on a site I
>> would not want to be associated with.
>>
>> I'm running apache 2 on my webserver, is there some way to block
>> traffic from this referrer, so when they hit the link there my server
>> refuses their request?
>>
>
> Hi Baza,
>
> You can use mod_rewrite to do this..
>
> I haven't tested this bit of configuration but I use something very
> similar on a few sites
>
> - -----
> RewriteEngine On
> #RewriteLog /var/log/apache2/rewrite.log < This is optional but useful
> for debugging
> #RewriteLogLevel 5 < Same here
>
> RewriteCond %{HTTP_REFERER} somedodgywebsite.com
> RewriteRule /(.*) http://baz's-website.com/redirectpage.html [P]
> - -----
>
> Replace somedodgywebsite.com with the name of the domain that is
> referring you to your site, or you could even use the full URL that is
> linking to you if you want to be more granular
>
> Replace "http://baz's-website.com/redirectpage.html" with a URL on
> your
> site that says "Hi, you have come here from such and such a site..
> blah
> blah blah."
>
> Let me know if that works - I'm interested to know.
>
> Thanks
>
>
> ~sm
Stupid question 23. Where do I put this? Do I put it in apache2.conf?
Baza
More information about the Wolves
mailing list