Like @DeltaG said, filtering the login_url
is a better option than using a .htaccess redirect. If you absolutely need to use .htaccess, follow @MrWhite answer.
Here is an approach using default WordPress hooks..
function wpse404009_redirect_to_custom_registration_page() {
global $pagenow;
if ( $pagenow == 'wp-login.php' && ! empty( $_REQUEST['action'] ) && $_REQUEST['action'] === 'register' ) {
//We are on the registration page, redirect now.
wp_redirect( get_permalink(999), 301 ); ; //Change 999 to the ID of your registration page
exit;
}
}
add_action( 'login_init', 'wpse404009_redirect_to_custom_registration_page' );
If you want to filter the login_url
.
function wpse404009_custom_login_page( $login_url, $redirect, $force_reauth ) {
//Get the custom login page URL.
$login_url = get_permalink(999); //Change 999 to the ID of your login page
if ( !empty($redirect)) {
$login_url = add_query_arg( 'redirect_to', urlencode( $redirect ), $login_url );
}
return $login_url;
}
add_filter( 'login_url', 'wpse404009_custom_login_page', 10, 3 );