I would like to redirect this page wp-login.php
to /login
page.
So when a user clicks on a link like this <a href="/wp-login.php">login</a>
, wordpress will redirect him to /register
.
I found this function and modified it :
add_action('init','custom_login');
function custom_login(){
global $pagenow;
if (( 'wp-login.php' == $pagenow ) && (!is_user_logged_in())) {
wp_redirect('/login');
exit();
}
I am not good with wordpress coding.
The redirection works fine, but the authentication seems to be broken.
When I enter my login/pass, the same page (/login
) reloads without being authenticated.
Any suggestion to fix the function for redirection ?
Link
might help.