Url Rules

Update Redirect rule

Updates one of a site's URL rules.

put/api/sites/multiscreen/site/{site_name}/urlrules/{id}

Request

  • Base URL
    https://api.duda.co
  • URL
    https://api.duda.co/api/sites/multiscreen/site/{site_name}/urlrules/{id}
  • Auth
    HTTP basic

Path parameters

site_namestring required

The site's unique name (its ID), returned when the site is created.

idstring required

Request body

response_codeinteger

Http response status code Supported values:

  • 301 (Moved Permanently)
  • 302 (Found) If not specified, defaults to 301
sourcestring required

Source path of the redirect Specified page must not exist on site and not be blank. Source page acts as secondary identifier: you can’t have two redirects with same source page

targetstring required

Target path of the redirect. Should correspond to an existing page on the site or an external url

If external url is provided, must start with “http/https” External domain is not validated

Example request

{
  "response_code": 301,
  "source": " 'old-page-url', '/old-page-url' ",
  "target": "'about', '/about', 'home', '/' (alternative to ‘home’), 'https://www.google.com'"
}

Response

OK

idstring

Identifier of redirect rule for referencing single object

response_codeinteger

Http response status code

sourcestring

Source path of the redirect

targetstring

Target path of the redirect

Example response

{
  "response_code": 301,
  "source": " 'missing-page', 'old-page' ",
  "target": " 'home', 'https://google.com' "
}

Changes

No recorded changes to this operation across all 1 revision of this API.