.htaccess - htaccess regex Keep spiderbots outside -


i can't part of htaccess working :


rewriteengine on rewritebase /  rewritecond %{http_user_agent} ^(360spider|acoon|ahrefs|aihit|altushost|amazon|archive|airjordanin|applecreek|baidu|bezeqint|bilbo|bork|botje|butterfly|buy) [nc,or] rewritecond %{http_user_agent} ^(catchbot|career|cloud-ips|coach|contabo|corbina) [nc,or] rewritecond %{http_user_agent} ^(dataprovider|digext|discobot|dotbot|ec2|edisterbot|energis|ephorus|exabot|exigen|ezooms|fastlink|genieo|huaweisymantecspider) [nc,or] rewritecond %{http_user_agent} ^(iguana|ileadz|ipxserver|jaunty|jadynave|jikespider|keywordspy|kimsufi|kobala|komodiabot|koula|longchamp) [nc,or] rewritecond %{http_user_agent} ^(magpie|majestic12|malas|media|michael|mj12bot|modx|mohitseo|mor306|mulberryoculos) [nc,or] rewritecond %{http_user_agent} ^(nashirnet|ncsa|netwiz|obot|openindex|osso|panscient|pathcom|peoplepal|piki|presto|purity) [nc,or] rewritecond %{http_user_agent} ^(santrex|scoutjet|shabnet|sistrix|siteexplorer|softlayer|sogou|sosospider|spinn3r|splims|statsbot|survey) [nc,or] rewritecond %{http_user_agent} ^(tangoo|targetdevelopmentdirect|thunderstone|trabajoo|track|trellian|trendictionbot|turnitinbot|tweetmemebot|ukraine) [nc,or] rewritecond %{http_user_agent} ^(vagabondo|vanekeris|vectranet|webcijfers|wise|yabrowser|yandex|yodao|zh-cn) [nc]  # issue 403 / serve errordocument rewriterule . - [f,l] 

tried without ^ @ beginning , $ @ end bots still coming, regarding statistics in php tried instead of http_user_agent referer , host , forwarded, , in numbers remote_address.

any ?

the rule looks far, though change 2 things.

  • exclude robots.txt rule, because many of these adhere robots exclusion standard. add

    rewritecond %{request_uri} !^/robots.txt$ 

    and fill robots.txt meaningful set of rules. if want exclude robots

    user-agent: * disallow: / 
  • change . ^, because home page not yet included in rule

    rewriterule ^ - [f] 

Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -