I wanted to add that you can do this on nginx too. Check:<br/>
&raquo; [Blocking WordPress User Enumeration on nginx - www.edwidget.name](http://www.edwiget.name/2013/10/blocking-wordpress-user-enumeration-on-nginx)

As a side note, I wanted to prevent username enumeration on my site hosted with WP Engine, which limits users' access to low level nginx config files. They do however, have a "Redirect Rules" section in their control panel which allows you to accomplish this. After some time I managed to figure out the best configuration:

    Redirect Name: // choose a description for the rewrite
    Domain: // you *must* select a domain; "All Domains" will *not* work here!
    Source: ^/$
    Destination: /?

Then you need to show the `Advanced Settings` panel...

    Match args: author=([0-9]*)
    Rewrite type: 301 Permanent

Et voila, your usernames are safe[r]!