Create automatic redirects from one URL to another for your domain. This is useful when changing website addresses or directing visitors to a new page. Returns an ID needed to manage or verify the redirect in subsequent calls.
Accept Example Content-Type Example domain_id string required domain_name string required source_url string required target_url string required status_code integer required redirect_scope string · enum required all exact root_www preserve_query_string boolean required include_subdomains boolean required subpath_matching boolean required description string required success boolean timestamp string requestId string data object error string message string code string timestamp string requestId string error string message string code string timestamp string requestId string error string message string code string timestamp string requestId string https://cloud.hostup.se/api/redirects curl -X POST "https://cloud.hostup.se/api/redirects" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"domain_id": "string",
"domain_name": "string",
"source_url": "string",
"target_url": "string",
"status_code": 0,
"redirect_scope": "all",
"preserve_query_string": true,
"include_subdomains": true,
"subpath_matching": true,
"description": "string"
}' {
"success": true,
"timestamp": "string",
"requestId": "string",
"data": {
"rule": {
"id": 0,
"domain_id": 0,
"domain_name": "string",
"cloudflare_zone_id": "string",
"cloudflare_ruleset_id": "string",
"cloudflare_rule_id": "string",
"source_url": "string",
"target_url": "string",
"status_code": 0,
"preserve_query_string": true,
"include_subdomains": true,
"preserve_path_suffix": true,
"subpath_matching": true,
"description": "string",
"enabled": true,
"created_at": "string",
"updated_at": "string",
"created_by": 0,
"redirect_scope": "string"
}
}
} {
"domain_id": "string",
"domain_name": "string",
"source_url": "string",
"target_url": "string",
"status_code": 0,
"redirect_scope": "all",
"preserve_query_string": true,
"include_subdomains": true,
"subpath_matching": true,
"description": "string"
}