I’m trying to stop wp-login.php spam from no referer user agent bots, but I’m having trouble finding the correct syntax for urls with ccTLDs. Is this something that will stop bots accessing wp-login.php on my .com.au domain?

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_METHOD} POST
    RewriteCond %{REQUEST_URI} .(wp-comments-post|wp-login).php*
    RewriteCond %{HTTP_REFERER} !.*mydomain.com.au.* [OR]
    RewriteCond %{HTTP_USER_AGENT} ^-?$ [OR]
    RewriteCond %{HTTP_REFERER}    ^-?$ [OR]
    RewriteCond %{HTTP_HOST}       ^-?$
    RewriteRule (.*) http://%{REMOTE_ADDR}/$ [R=301,L]

Will this work? Or do I have to escape the .au (.au)? Thanks for your help.

Read more here: Limiting Access to wp-login with htaccess when .cctld is included


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Related Wordpress search:

, , , , ,

Wordpress related questions and answers: