Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter sipw

    (@sipw)

    Got it. The "action_data" field must be an object containing a "url" key, not just a string.

    Thread Starter sipw

    (@sipw)

    Ok many thanks. The only issue we’re hitting now is with passing the action_data – it’s being saved as null. Redirections are created, just obviously with no target url.

    {
    “url”: “/test-source”,
    “action_data”: “/test-target”,
    “match_type”: “url”,
    “action_type”: “url”,
    “group_id”: 1,
    “enabled”: true
    }

    {
    "id": 6467,
    "url": "/test-source",
    "match_url": "/test-source",
    "match_data": {
    "source": {
    "flag_query": "exact",
    "flag_case": true,
    "flag_trailing": true,
    "flag_regex": false
    }
    },
    "action_code": 301,
    "action_type": "url",
    "action_data": null,
    "match_type": "url",
    "title": "",
    "hits": 0,
    "regex": false,
    "group_id": 1,
    "position": 0,
    "last_access": "-",
    "enabled": true
    }
    Thread Starter sipw

    (@sipw)

    Thanks for the swift response!

    Initially, we explored using hooks because we assumed they were the intended way. They offered potential advantages such as better performance, no need for authentication, and no additional HTTP requests. Plus, we referred to your hooks documentation, which seemed to suggest they might be appropriate.

    We’re creating redirects for URLs that are removed during an API call. When these URLs are no longer available in the API, we need to create redirects to a fallback page.

    However, we’ve since shifted to using the REST API. The issue we’re facing with the API is persistent timeouts (cURL error 28), even with extended timeouts and valid authentication. The /wp-json/redirection/v1/redirect endpoint doesn’t respond within the allocated time, despite other REST API functionality on the site working fine. We’re trying to determine if this is a plugin-specific issue, server configuration problem, or something else.

Viewing 3 replies - 1 through 3 (of 3 total)