<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_REFERER} !\?PARAM$
RewriteCond %{HTTP_COOKIE} !^.*wordpress_logged_in_.*$
RewriteCond %{QUERY_STRING} !^PARAM$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} ^/wp-admin [NC]
RewriteRule ^(.*)$ /empty_file.php [R,L]
RewriteCond %{HTTP_REFERER} !\?PARAM$
RewriteCond %{HTTP_REFERER} !%2Fwp-admin%2F%3FPARAM&reauth=1$ [NC]
RewriteCond %{HTTP_COOKIE} !^.*wordpress_logged_in_.*$
RewriteCond %{QUERY_STRING} !^PARAM$
RewriteCond %{QUERY_STRING} !%2Fwp-admin%2F%3FPARAM&reauth=1$ [NC]
RewriteCond %{QUERY_STRING} !^action=logout
RewriteCond %{QUERY_STRING} !^action=rp
RewriteCond %{QUERY_STRING} !^action=postpass
RewriteCond %{REQUEST_URI} ^/wp-login\.php
RewriteRule ^(.*)$ /empty_file.php [R,L]
RewriteCond %{QUERY_STRING} ^loggedout=true
RewriteRule ^.*$ /wp-login.php?PARAM [R,L]
</IfModule>