Csrf是什么请自行百度哟。

针对Apache

SetEnvIfNoCase Request_Method post csrf
SetEnvIfNoCase Referer ^http://hiwbb\.com !csrf

<LocationMatch />
    Order Deny, Allow
    Deny from env=csrf
</LocationMatch>

针对Lighttpd

$HTTP["request-method"] == "POST" {
          $HTTP["referer"] !~ "^($|http://hiwbb\.com)" {
              url.access-deny = ( "" )
          }
      }