Apache Forbidden to specify user_agent
User_agent We call it the browser logo, the current mainstream browser has IE, Chrome, Firefox, on the iphone safari, Android phone, Baidu search engine, Google search engine and so many, Each browser has a corresponding user_agent.
The configuration is as follows:
<ifmodule mod_rewrite.c>
Rewriteengine on
Rewritecond%{http_user_agent} ^.*firefox/4.0.* [Nc,or]
Rewritecond%{http_user_agent} ^.*tomato bot/1.0.* [NC]
Rewriterule. *-[F]
</IfModule>
It is also possible to use the rewrite module to implement the restriction specified user_agent, in this case, rewriterule. * * [F] can be directly forbidden to access, Rewritecond with User_agent to match, *firefox/4.0* said, As long as the user_agent contains firefox/4.0 in the condition, where * denotes any character, NC means case-insensitive, or represents or, joins the next condition. If I want to limit Baidu's search engine now, can add one such rule:
Rewritecond%{http_user_agent} ^.*baiduspider/2.0.* [NC]
Rewriterule. *-[F]
[Nc,or] It means yes or no; [NC] meaning yes and.
This article from "12350027" blog, declined reprint!
Apache prohibits the designation of user_agent