Create redirect
Create a redirect in your site
POST api/servers/{server}/sites/{site}/redirects
Parameters
Parameter | Type | Status | Description |
---|---|---|---|
redirect_from | string | required | The path where you want to redirect from |
redirect_to | string | required | The path where you want to redirect to |
type | string | required | Possible values: permanent , redirect |
Example request:
curl -X POST "https://ploi.io/api/servers/{server}/sites/{site}/redirects" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
--data '{
"redirect_from": "/",
"redirect_to": "/home",
"type": "permanent"
}'
Example response:
HTTP/1.1 201 CREATED
Content-Type: application/json
{
"data": {
"id": 1,
"status": "created",
"redirect_from": "/",
"redirect_to": "/home",
"type": "permanent"
}
}