Login & Logout redirect problems

Hi i have problems whit this 2 plugins.
Login redirect plugin, i cant find that option in network admin > network settings i see same problem here https://premium.wpmudev.org/forums/topic/i-am-unable-to-find-where-to-put-the-redirect-link-i-go

and for logout redirect: if i set bettingtip.info users go to bettingtip.info/bettingtip.info and if i leave it blank then if user is on blog1.bettingtip.info he stay on that page! i want to users after login or logout go to main site bettingtip.info.

see why i want to login redirect to main site not dashboard: if admin of blog1.bettingtip.info dont use bettingtip.info/wp-admin , if he use my main site and click on login it appers this message (see image). from that reason its better that login redirect user to main site and then he can go to dashboard using top bar.

  • Patrick

    Hi there @Nikola

    I hope you're well today!

    I just tested both issues on my development site. When a user logs out from a subsite in my network, they are correctly redirected to the homepage of my main site, as I have set it up.

    Do you have any other redirect plugins or scripts active on your site?

    As for the Login redirect plugin issue, you are correct: when network activated, there is no setting for it in the network admin. I've filed a bug report for that and have notified the plugin developer.

  • Nikola

    @Patrick
    logout redirect works now, i set up http://bettingtip.info
    tell me do you have some idea to solve next problem, most users (who alredy have blogs) will use login form on main page and then he will se this message:

    You attempted to access the "BettingTip.info" dashboard, but you do not currently have privileges on this site. If you believe you should be able to access the "BettingTip.info" dashboard, please contact your network administrator.

    If you reached this screen by accident and meant to visit one of your own sites, here are some shortcuts to help you find your way.
    Your Sites
    markovic1 Visit Dashboard | View Site

    most of them will not use their-blog.bettingtip.info/wp-admin to login
    they can access their dashboard over main site but they will see this message.. because of that i was interested in login redirect, to send them to main site (their can later go to dashboard)

    do you have an idea how to solve that without login redirect?

  • Sajid

    Hi @Nikola

    Hope you are doing good today :slight_smile:

    Mean while our developer are working on the bug and release an update, you can use below code to redirect to home page of your main site.

    Add in function.php file of your child theme or use mu-plugin (use mu to network activate).

    function my_login_redirect( $redirect_to, $request, $user ) {
    	//is there a user to check?
    	global $user;
    	if ( isset( $user->roles ) && is_array( $user->roles ) ) {
    		//check for admins
    		if ( in_array( 'administrator', $user->roles ) ) {
    			// redirect them to the default place
    			return $redirect_to;
    		} else {
    			return home_url();
    		}
    	} else {
    		return $redirect_to;
    	}
    }
    add_filter( 'login_redirect', 'my_login_redirect', 10, 3 );

    Take care and have a nice day :slight_smile:

    Cheers, Sajid

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.