• Hi,
    We are using the plugin to redirect users to specific pages based on their wp roles. This is working really well and we have not had any issues so far.
    However, one thing we have noticed is that, if the user clicks on a shortcut URL to a specific page in the site, it still redirects them to the ‘home page’ of that user rather than to the specific page e.g. shortcut has https://intranet.home.com/hr/policies, but when you click on it it takes them to https://intranet.home.com/homepage (this is the redirect in place) – We would like them to go directly to the page requested. If the user is already logged on, then it goes directly to the correct page. This only happens is the user is not logged on (i hope that makes sense)
    Is there a way to get the users to get redirected to the original URL that they clicked on?
    FYI: I am a novice on WordPress
    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Just fixed same issue for myself:

    function ovni_login_redirect_rule($custom_redirect_to, $redirect_to, $requested_redirect_to, $user){
    	global $wp;
    	if (!$requested_redirect_to){
    		return(wp_get_referer());  // back to page with login form
    		}
    	return($custom_redirect_to);  // else follow redirect
    	}
    add_filter('rul_before_user', 'ovni_login_redirect_rule', 10, 4);

    In my case, if there is no redirect it is because they are logging on via a widget on the page and I want to keep them on that page. If there is a redirect, it is because they followed a link to a page that requires a login. In this case we go to the redirect page.

    Hello
    I am in need of bit clarification .I am not good with PHP.
    I am using role to redirect. Once the user is loged in, i want keep them on the landing page where they are redirected. now when they click site logo, it take them to other users, page. how to solve.

    Pls help.
    thanks millions. !

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Redirect to original URL’ is closed to new replies.