.htaccess 如何阻止空的用户代理请求

.htaccess 如何阻止空的用户代理请求,.htaccess,.htaccess,是否有任何解决方案可以防止http请求具有空用户代理字符串,最好使用.htaccess?#重定向空用户代理,除非它正在访问RSS提要 #redirect empty user agent, UNLESS it's accessing the RSS feed RewriteCond %{HTTP_USER_AGENT} ^$ RewriteCond %{REQUEST_URI} !^/rss.php # <-- path to rss.php RewriteRule .* http://

是否有任何解决方案可以防止http请求具有空用户代理字符串,最好使用.htaccess?

#重定向空用户代理,除非它正在访问RSS提要
#redirect empty user agent, UNLESS it's accessing the RSS feed
RewriteCond %{HTTP_USER_AGENT} ^$ 
RewriteCond %{REQUEST_URI} !^/rss.php # <-- path to rss.php
RewriteRule .* http://%{REMOTE_ADDR}/ [R,L]
RewriteCond%{HTTP_USER_AGENT}^$ 重写cond%{REQUEST_URI}^/rss.php#