Contents
On this page

Resolve URL - Plugixa Permalink Manager

GET /plugixa-permalink-manager/v1/debug/resolve

Ask which stored address or redirect a URL on this site matches, the way a real request would be resolved, and optionally what a visitor actually gets.

Needs the plugixa_permalink_manager_view capability.

Nothing is sent to the visitor and nothing is saved. With live=1 the server makes one HEAD request to the URL, redirects not followed, so the answer includes what other plugins, the theme or the host do. Only this site’s own URLs are accepted. This is what the Debug screen shows.

Request

GET https://your-site.example/wp-json/plugixa-permalink-manager/v1/debug/resolve?url=/shop/tents/skyline-2&live=1

Query parameters

Name Type Default Description
url string Required. A full URL on this site, or a path
live boolean false Also request the URL and report the real answer

Responses

200 OK.

{
  "success": true,
  "data": {
    "url": "https://your-site.example/shop/tents/skyline-2",
    "path": "shop/tents/skyline-2",
    "language": "",
    "serving": true,
    "reason": null,
    "readings": [
      {
        "uri": "shop/tents/skyline-2",
        "endpoint": null
      }
    ],
    "match": {
      "object": {
        "kind": "post",
        "id": 36,
        "subtype": "product",
        "status": "publish",
        "title": "Skyline 2 Tent",
        "link": "https://your-site.example/shop/tents/skyline-2/",
        "edit_url": "https://your-site.example/wp-admin/post.php?post=36&action=edit"
      },
      "uri": "shop/tents/skyline-2",
      "mode": -1,
      "reading": {
        "uri": "shop/tents/skyline-2",
        "endpoint": null
      },
      "query_vars": {
        "post_type": "product",
        "name": "skyline-2",
        "p": 36,
        "product": "skyline-2"
      }
    },
    "redirect": null,
    "live": {
      "status": 301,
      "location": "https://your-site.example/shop/tents/skyline-2/",
      "redirect_by": "WordPress"
    }
  }
}
Field Type Meaning
data.path string The path below the site’s home, without outer slashes
data.language string The language detected from the path, empty on a single-language site
data.serving boolean Whether the plugin is serving its addresses
data.reason string|null Why it is not: safe_mode_constant, conflict (another permalink plugin is active), plain_permalinks or safe_mode_setting
data.readings array The ways the path can be read: an address, plus an endpoint such as page/2, feed or comment-page-2
data.match object|null The stored address the path matches: the item, its uri and mode, the reading that matched, and the WordPress query it becomes
data.redirect object|null When nothing matches, the stored redirect that leaves from the path: endpoint, kind, source, status_code, target and object
data.live object|null With live: status, location and redirect_by (the X-Redirect-By header), or error when the request failed

Errors

Status Code When
422 plugixa_permalink_manager_not_this_site url is empty or on another host.
400 rest_missing_callback_param url is missing.

Plus the errors every endpoint can return.

Examples

curl -s "https://your-site.example/wp-json/plugixa-permalink-manager/v1/debug/resolve?url=/shop/tents/skyline-2&live=1" \
  -u "admin:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-permalink-manager/v1/debug/resolve?url=/shop/tents/skyline-2&live=1');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_USERPWD        => 'admin:' . getenv('WP_APP_PASSWORD'),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const auth = 'Basic ' + btoa(`admin:${process.env.WP_APP_PASSWORD}`);
const response = await fetch('https://your-site.example/wp-json/plugixa-permalink-manager/v1/debug/resolve?url=/shop/tents/skyline-2&live=1', {
  headers: { 'Authorization': auth },
});
const { data } = await response.json();

Quick Links

Share