Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a WordPress website which accepts anonymous comments and images. We are receiving spam in the form of Russian porn, with images hotlinked from websites on the Russian domain .ru

As we are unlikely to ever need to legitimately link to a Russian picture, I thought the easiest way to not have to look at this in the spam folder would be to use .htaccess to redirect any image on an .ru domain to something that doesn't exist.

Is this possible? What would I need to add to my .htaccess?

share|improve this question

migrated from stackoverflow.com May 12 '11 at 10:20

This question came from our site for professional and enthusiast programmers.

You can't do that with .htaccess, as requests for those images don't come from your server. Instead write a filter on your comments that either checks for .ru and then blocks the comment, or use someone elses code to filter comments.

The Askimet plugin is pretty good at preventing spam – have you got that installed?

share|improve this answer
We will be trialling the Akismet plugin soon, and I already have a filter that makes those entries go into 'Spam', but I wanted to make it so even if you're looking in the 'spam' folder, you don't see the pictures. – Shaun May 12 '11 at 16:29

Your Answer


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.