I am just trying to change the url of “register” on wp default login page(domain.com/wp-login.php)
-
I want to change the url on register link.
-
when you are on domain.com/wp-login.php?action=register, I want to redirect to domain.com/register
I have added redirect link. but it’s not working.
RedirectMatch 301 /wp-login.php?action=register$ http://domain.com/register/$1
Am I missing something?
I just want to use my register page (domain.com/register/)
3 Answers
Code from @bainternet’s website.
function wpse127636_register_url($link){
/*
Change wp registration url
*/
return str_replace(site_url('wp-login.php?action=register', 'login'),site_url('register', 'login'),$link);
}
add_filter('register','wpse127636_register_url');
function wpse127636_fix_register_urls($url, $path, $orig_scheme){
/*
Site URL hack to overwrite register url
http://en.bainternet.info/2012/wordpress-easy-login-url-with-no-htaccess
*/
if ($orig_scheme !== 'login')
return $url;
if ($path == 'wp-login.php?action=register')
return site_url('register', 'login');
return $url;
}
add_filter('site_url', 'wpse127636_fix_register_urls', 10, 3);