I have a wordpress site, where after use logs in, I want them to redirect to different site. How can i do this in wordpress? setting the php header function( header( “Location: http://www.somesite.com” ) ) didn’t work, it said headers were already set in header.php file. So basically how do i redirect via wordpress?
Does wordpress have it’s own re direct function, where i can use it to redirect safely out of a wordpress site? I have no idea what else to do, so please help me, thanks.
In normal pages, you can use
wp_redirect(see Function Reference/wp_redirect)To allow redirection to other sites, add the following to
functions.php(replacing ‘other’ with your values):Normally, if there is a
redirect_toquerystring value on the login page’s URL, it will attempt to redirect to that location after authenticating.To change where the login will redirect users regardless of the
redirect_toquerystring value, again add tofunctions.php(replacing the location with your values):For logging out and redirectng to another site, you can then use something like: