Block images on Russian domain .ru via htaccess?

Block images on Russian domain .ru via htaccess? - .htaccess files are extremely useful in many cases for users who either do not have root permissions or for users who simply aren't comfortable in making changes in their web server's configuration file. Trying to debug .htaccess not working isn't always the easiest thing to do, however, hopefully by checking the discuss below mentioned about wordpress, htaccess, spam, images, .htaccess common problems as well as the troubleshooting tips, you'll have a better grasp on what you may have to modify to get your .htaccess file running smoothly.Problem :


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?


Solution :

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?


Additionally, if you would like to do some further testing, give the htaccess tester tool a try. It allows you to specify a certain URL as well as the rules you would like to include and then shows which rules were tested, which ones met the criteria, and which ones were executed.

Comments

Popular posts from this blog

Rewrite in Mediawiki, remove index.php, .htaccess

.htaccess rewrite wildcard folder paths from host

Using .htaccess to set a cookie and 301 redirect