Question with .htaccess and wp-login.php prevention

I’ve found a solution – this needs to be added to the .htaccess

 ErrorDocument 403 /path-to-your-site/index.php?error=404