Skip to main content

A zap with 3 steps…

  1. Webhook to catch 2 parameters from WordPress.
  2. Filter condition
  3. Webhook to request a redirection to a target url on WordPress,

Zap ran successfully, but did not really trigger the redirection on WordPress,

Tried to create a function handle_custom_redirect, same issue.

Tried to use redirection plugin, but the plugin author answered: It’s not possible to redirect a REST API route.

Tried to add the Nginx rules for the custom redirect. Tested  https://see.architdz.tempurl.host/wp-json/custom/v1/precourse-redirect in browser will redirect to target url correctly.

But Webhook custom request with same url as above and method GET, sent successfully, but did not really trigger the redirection on WordPress,

Any idea why this is happening?

Thanks

p.s. Saw a discussion for “Webhooks need the ability to send 303 redirect response” as a feature request 2 years ago, is there something we should know?

 

 

 

 

Hi @samlizen 

Usually that type of redirect logic would need to be configured directly in WordPress.


Hi @Troy Tessalone 

 

Thanks for reply.

The zap with 3 steps is only a test. The actually workflow will get 2 parameters from WordPress, after comparing the course that the user attempted to take and the courses that the user had enrolled before in Moodle, to determine whether the user needs to attend the Pre-Course or not.

 

So there will be 2 paths at the end, one should redirect to target url if requirePrecourse is true. How can I configure it in WordPress? Is it possible to trigger "Redirection" plugin with custom request?

 

Your help is much appreciated.

 


Reply