• Resolved rbryant123

    (@rbryant123)


    I downloaded the “Free” version and thought I would try it for a new clients project and can’t seem to get the redirect to work. This client has about a dozen clients of their own that they have created files for, in a separate program, with an entirely different Domain Name. When I created a sample to test, all the redirect did, once the Login process completed, is to go to their own Home Page. Why won’t they redirect bring the Login process to a completely different URl rather than the original one?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Matt Biscay

    (@skyminds)

    Hi Ron,

    That’s a limitation from WordPress: by default, wp_safe_redirect() only accepts urls from the origin domain, not external URLs, for safety reasons.

    If you wish to whitelist some external URLs, you need to add this snippet of code to your uitlity plugin (or your child theme’s functions.php):

    add_filter( 'allowed_redirect_hosts', 'slr_extend_allowed_domains_list' );
    
    function slr_extend_allowed_domains_list( $hosts ){
    
    	$hosts[] = 'example.com';
    	$hosts[] = 'utopique.net';
    
    	return $hosts;
    });

    Best regards,
    Matt

    Thread Starter rbryant123

    (@rbryant123)

    Thanks Matt. I am not versed enough to modify the actual file, so I installed Code Snippet and added the code you recommended. I got an error message for “line 9” which I think may be “return $hosts;” any chance the code may be wrong?

    Thanks
    Ron

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Can’t Redirect To A Completely Different URL’ is closed to new replies.