Apache禁止指定user_agent

# 域名跳转

   <IfModule mod_rewrite.c>

   RewriteEngine on
   RewriteCond %{HTTP_HOST} ^www.aaa.com$

   RewriteRule ^/(.*)$ http://www.aa.com/$1 [R=301,L]

#

#Apache禁止指定user_agent

  RewriteCond %{HTTP_USER_AGENT} ^.*http.* [NC,OR]

  RewriteCond %{HTTP_USER_AGENT} ^*Tomato Bot/1.0* [NC]

  RewriteRule .* -[F]

#限制目录访问

#

 RewriteCond %{REQUEST_URI} ^.*/tmp/.* [NC]

 RewriteRule .* -[F]

     </IfModule>


你可能感兴趣的:(Apache禁止指定user_agent)