For the complete documentation index, see llms.txt. This page is also available as Markdown.

Create website redirect

Creates a redirect from a URL on the selected website to another URL or IP address.

Create website redirect

post

Creates a redirect from a URL on the selected website to another URL or IP address.

Authorizations
AuthorizationstringRequired

API Token authentication

Path parameters
usernamestringRequiredExample: u123456789
domainstringRequired

Domain name

Example: mydomain.tld
Body
fromstring · max: 255Required

Source URL on the selected website

Example: https://example.com/old-page
tostring · max: 255Required

Destination URL or IP address

Example: https://example.com/new-page
Responses
200

Success response

application/json
fromstringOptional

Source URL

Example: https://example.com/old-page
tostringOptional

Destination URL

Example: https://example.com/new-page
post/api/hosting/v1/accounts/{username}/websites/{domain}/redirects
POST /api/hosting/v1/accounts/{username}/websites/{domain}/redirects HTTP/1.1
Host: developers.hostinger.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 75

{
  "from": "https://example.com/old-page",
  "to": "https://example.com/new-page"
}
{
  "from": "https://example.com/old-page",
  "to": "https://example.com/new-page"
}

Last updated

Was this helpful?