1

assuming that I have been redirected from an external API, to my front page website, and in the current url there is some query parameter provided by that API, how can I get those parameters and make a redirection to an external website, before my front page website have rendered ? Example:

// This is the url returned by the external api, so it redirects users to my website

         https://mywebsite.com&redirect_uri=otherwebsite.com

// So I would like to get the redirect_uri parameter value and make a redirection to that url, like so:

              wp_redirect( $_GET[‘redirect_uri’] );
              exit;

The most important question here would be, which hook should I use to get all this things done ??, like I said, BEFORE my front page website get rendered. I don’t know if using $_GET is enough to get the parameter neither. So I need help, thank you!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.