Archive for the 'Server-Linux' Category

วันนี้มีวิธีการ Block spam ที่ยิงมาจากเว็บอื่นโดยใช้ .htaccess ครับ  โค้ดตามด้านล่างนี่เลย

# set the spam_ref variable
SetEnvIfNoCase Referer "^http://(www.)?some-spammer.com" spam_ref=1

SetEnvIfNoCase Referer "^http://(www.)?other-spammer.com" spam_ref=1

SetEnvIfNoCase Referer "^casino-poker" spam_ref=1

# block all referres that have spam_ref set
<FilesMatch "(.*)">
Order Allow,Deny
Allow from all
Deny from env=spam_ref
</FilesMatch>


ตัวอย่างการใช้งาน

SetEnvIfNoCase Referer "คำ หรือ url ที่ต้องการ Block referrer" spam_ref=1

เครดิตจาก http://www.besthostratings.com/articles/block-referrer-spam.html