Create website redirect
Creates a redirect from a URL on the selected website to another URL or IP address.
Creates a redirect from a URL on the selected website to another URL or IP address.
Authorizations
AuthorizationstringRequired
API Token authentication
Path parameters
usernamestringRequiredExample:
u123456789domainstringRequiredExample:
Domain name
mydomain.tldBody
fromstring · max: 255RequiredExample:
Source URL on the selected website
https://example.com/old-pagetostring · max: 255RequiredExample:
Destination URL or IP address
https://example.com/new-pageResponses
200
Success response
application/json
fromstringOptionalExample:
Source URL
https://example.com/old-pagetostringOptionalExample:
Destination URL
https://example.com/new-page401
Unauthenticated response
application/json
422
Validation error response
application/json
500
Error response
application/json
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?