API Documentation

Redirect

Resources for managing redirects.

/{iid}/redirects/{uuid}

PUT

Create a new redirect.

Posting to this resource creates a new redirect.

Sample Call

>>> PUT("/123/redirects/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb",
...                       {'pattern': '/Rome/**',
...                        'template': '/Vacations/Rome/\1',
...                        'ord': 1})
{'url': 'https://api.metropublisher.com/123/redirects/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb',
 'uuid': 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb'}

Parameters

pattern:

Pattern: The pattern for the original URL you want to be redirected.

required

must be unique within instance

template:

Template: The destination URL template to which you want the original URL be redirected.

required

must either be an absolute url matching the following regular expression:

^[A-Za-z][-A-Za-z0-9+\.]*:

or must start with '/' (a host relative url) For example, accepted values are:

http://example.com/redirect_here
/redirect_here
ord:

Order number: Defines the order by which redirect rules are applied.

required

Table Of Contents

Previous topic

Locations

Next topic

Section