The user agent blocking code in my .htaccess file stopped working, though I didn't make any recent changes to it. To troubleshoot this I changed the user agent in FF and created a sub-directory with its own .htaccess file and one php file. In that file I added code to display the $_SERVER['USER_AGENT'] string. It shows the UA I am using and is:
Mozilla/5.0 (compatible; Konqueror/4.2; Linux) KHTML/4.2.96 (like Gecko)
In my .htaccess file I have the following but when I visit that location I am not blocked.
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} "^Konqueror$" [NC]
RewriteRule ^ - [F]
I added the following, with my real IP, after the above to verify the rewrite was working and it blocked me:
RewriteCond %{REMOTE_ADDR} ^12\.23\.45\.666
RewriteRule ^ - [F]
Does anyone know what the problem is?