I want to change the login url of my WordPress install away from /wp-admin.php
I am aiming to do so and am looking at changing the .htaccess file to add in:
RewriteRule ^login$ http://yourdomain.com/wp-login.php [NC, L]
From what I gather however, going to /wp-admin will still allows people to login using that link. I was thinking of doing some sort of PHP redirect so that when the user types in /wp-admin it goes to the 404 not found page.
What is the best way to change the login URL without using a plugin and with the highest security standards?
6 s
About changing the login url, i already did by mysel.
It help me protect my site and prevent brute force
You can change it in htaccess.
But you also need to add the filter to replace old login url in wordpress.
Example to my website:
File .htaccess:
RewriteRule ^signin(.*) wp-login.php?%{QUERY_STRING}
In your theme or custom plugin, you can add the filter to make sure wordpress show the correct login url .
add_filter( 'login_url', 'my_login_page', 10, 2 );
function my_login_page( $login_url, $redirect ) {
return str_replace("wp-login.php","signin",$login_url);
}
add_action( 'login_form', 'replace_login_submit_form',1);
function replace_login_submit_form() {
$your_content = ob_get_contents();
$your_content = str_replace("wp-login.php","signin",$your_content);
ob_get_clean();
echo $your_content;
}
Hope it can help you!