• Resolved perryrylance

    (@perryrylance)


    Hi there

    We are experiencing an issue with this plugin when POSTing to a REST URL.

    Our URL has a trailing slash, for example:

    http://localhost/wp-json/wpgmza/v1/datatables/

    The request also contains POST data.

    Your plugin is issuing a redirect to

    http://localhost/wp-json/wpgmza/v1/datatables

    Unfortunately the POST body is lost and the request is sent as a GET request, causing our plugin to break.

    Is there a workaround or solution for this please?

    Kind regards
    – Perry

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Maciej Bis

    (@mbis)

    Hi Perry,

    to stop the redirect functions triggered by my plugin, you can call $wp_query global and define ‘do_not_redirect’ parameter:

    global $wp_query;
    if(!empty($wp_query->query_vars)) {
    $wp_query->query_vars['do_not_redirect'] = 1;
    }

    Best regards,
    Maciej

    Thread Starter perryrylance

    (@perryrylance)

    Hi Maciej

    That’s superb thank you, we tried this and it works!

    You can consider this issue solved.

    Kind regards
    – Perry

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Redirect strips trailing slash and POST’ is closed to new replies.