longtone Posted December 15, 2009 Share Posted December 15, 2009 In cPanel there is a bot: "Unknown robot (identified by 'bot*')" and it's using 30% of of the bandwidth I used mod_rewrite to block a number of known bad bots, and added the line: RewriteCond %{HTTP_USER_AGENT} ^bot* The bandwidth used by bot* did decrease (from about 40%), but it didn't stop I'm not sure if I'm doing this right, whether * is a wildcard, and whether I should be putting bot.* instead of bot*, or if it's an actual asterisk and I should be escaping it. Or maybe it's a whole range of different bots, all starting with 'bot' Or is it possible (or desirable) to block all robots except Google, yahoo and MSN? Any ideas? Link to comment https://forums.phpfreaks.com/topic/185213-how-to-block-unknown-robots-with-mod_rewrite/ Share on other sites More sharing options...
Daniel0 Posted December 17, 2009 Share Posted December 17, 2009 You would do something like this: RewriteCond %{HTTP_USER_AGENT} ^bot* [NC] RewriteRule .* - [F,L] The NC makes it case insensitive, the F means it'll give a 403 Forbidden response code and the L means the mod_rewrite chain stops on a successful match. Link to comment https://forums.phpfreaks.com/topic/185213-how-to-block-unknown-robots-with-mod_rewrite/#findComment-978848 Share on other sites More sharing options...
longtone Posted December 17, 2009 Author Share Posted December 17, 2009 Thanks, I didn't know about the [NC], I'll give it a try Link to comment https://forums.phpfreaks.com/topic/185213-how-to-block-unknown-robots-with-mod_rewrite/#findComment-979543 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.