Skip to content

[BUG] Programmatic Domain Parking (Alias) via API to avoid 409 Conflict #3

@JhonesSena

Description

@JhonesSena

Problem Description: I am building a multi-tenant platform (SaaS) on Hostinger Shared Hosting that requires dynamic subdomains (e.g., client.domain.com). My DNS is managed by Cloudflare with a wildcard record.

Currently, I face a 409 Conflict (hws) error whenever I try to access a subdomain that hasn't been manually "parked" in the hPanel. While manual parking works, it is not scalable for 300+ clients.

Technical Setup:

DNS: Cloudflare Wildcard * -> Hostinger IP.

Worker: A Cloudflare Worker is used to rewrite the Host header to the main domain to bypass VHost restrictions.

PHP SDK: I am using hostinger/api-php-sdk but couldn't find a method for addAlias or parkDomain.

Questions:

Is there an undocumented endpoint in the Hostinger API that allows parking/aliasing a domain programmatically?

Can the POST /api/hosting/v1/websites endpoint be configured to act as a domain alias instead of a standalone website?

Is there any specific server-side header (besides Host) that the Hostinger firewall (hws) looks for to authorize requests from a Cloudflare Worker?

Environment:

SDK Version: Latest

PHP Version: 8.x

Hosting Plan: Business Shared Hosting

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions