Create a redirect
Log in to add to favouritesPOST/api/management/projects/{project}/redirects/
Parameters
Name | Parameter type | Type | Description |
---|---|---|---|
projectId(required) | path | string | The project identifier found in the project overview screen of the management console. |
redirect(required) | body | object | The redirect to create |
Responses
Examples
Begins with match
{
"sourceDomain": "example.com",
"destination": "/new-path",
"statusCode": 301,
"match": {
"type": "beginsWith",
"value": "/old-path"
}
}
Exact match
{
"sourceDomain": "example.com",
"destination": "/exact-destination",
"statusCode": 301,
"match": {
"type": "exactMatch",
"value": "/specific-path"
}
}
Regex match (PCRE format)
{
"sourceDomain": "example.com",
"destination": "/regex-destination",
"statusCode": 301,
"match": {
"type": "regex",
"value": "^/products/(.*){{APP}}quot;
}
}
Begins with match with appending path
{
"sourceDomain": "example.net",
"destination": "/updated-path",
"statusCode": 302,
"appendSourcePathToDestination": true,
"match": {
"type": "beginsWith",
"value": "/start-here"
}
}
Exact Match with Temporary Redirect
{
"sourceDomain": "example.org",
"destination": "/temporary-redirect",
"statusCode": 302,
"match": {
"type": "exactMatch",
"value": "/temporary-path"
}
}