one page redirect when on specific page

Home Forums Legacy Support Support queries Setup issues one page redirect when on specific page

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #372946
    MeesterGijs
    Spectator
    Hello, I don't need any redirects when loggin in, only after registration. Which is fixed. But I have a goodbye page that members see after loggin out. I want that page, meestergijs.nl/bye to redirect to meestergijs.nl/cursusaanbod when they log IN from that page. So just one redirect from meestergijs.nl/bye to /cursusaanbod. Is that possible? Gijs
    #372990
    Veronica
    Moderator
    hi try to add this in wplms-customizer.php
    
    function login_redirect( $redirect_to, $request, $user ){
    	global $wp;
    	$current_slug = add_query_arg( array(), $wp->request );
    	if(strpos( $current_slug,'bye')!==false){
    		$redirect_to = 'https://meestergijs.nl/cursusaanbod';
    	}
        return  $redirect_to;
    }
    add_filter( 'login_redirect', 'login_redirect', 989898989, 3 );
    #373017
    MeesterGijs
    Spectator
    It's not working. Still leaves me at meestergijs.nl/bye Should I change something to the code?
    #373174
    Veronica
    Moderator
    hi have you added any login redirect code on your site? or any code related to redirect?
    #373238
    MeesterGijs
    Spectator
    This reply has been marked as private.
    #373349
    Veronica
    Moderator
    function login_redirect( $redirect_to, $request, $user ){
    	global $wp;
    	$current_slug = add_query_arg( array(), $wp->request );
    	if(strpos( $current_slug,'bye')!==false){
    		$redirect_to = 'https://meestergijs.nl/cursusaanbod';
    	}
        return  $redirect_to;
    }
    add_filter( 'login_redirect', 'login_redirect', 1, 3 );
    try to change the priority here: put 2 or 3 http://prntscr.com/1x37yom
    #373404
    MeesterGijs
    Spectator
    This reply has been marked as private.
    #373510
    Veronica
    Moderator
    ok let me check this again ping us here for the same please
    #373549
    MeesterGijs
    Spectator
    And?
    #373593
    Veronica
    Moderator
    hi this code will not work as in this code it needs to detect the old URL but in WP it changes the URL so to get the current slug of the page become null so this requirement is not possible right now
    #373606
    MeesterGijs
    Spectator
    Is there a way around the problem?
    #373638
    Veronica
    Moderator
    no dear
    #373697
    MeesterGijs
    Spectator
    oh, let's close :)
    #373716
    Veronica
    Moderator
    topic closed
Viewing 14 posts - 1 through 14 (of 14 total)
  • The topic ‘one page redirect when on specific page’ is closed to new replies.