How I Host Multiple Product Subdomains Using GitHub Pages and Hostinger

How I Host Multiple Product Subdomains Using GitHub Pages and Hostinger

When building a startup with multiple products, I wanted a setup that was simple, cost-effective, and repeatable.

My requirements were clear:

  • One main startup domain
  • Multiple product subdomains
  • No extra domain purchases
  • Static hosting
  • Clean DNS management
  • HTTPS by default

This article documents the exact process I now follow every time I launch a new product site using GitHub Pages and Hostinger DNS.


The Target Setup

Assume a main domain:

example.com        

And product subdomains like:

product1.example.com
product2.example.com
product3.example.com        

Each product:

  • Has its own GitHub repository
  • Is hosted on GitHub Pages
  • Is mapped via Hostinger DNS
  • Uses HTTPS


Prerequisites

Before starting, ensure:

  • The main domain is already live
  • DNS is managed in Hostinger
  • GitHub Pages is enabled for public repositories
  • Each product will have its own repository

Step 1: Create a GitHub Repository

For each product:

  • Create a new public GitHub repository
  • Add your site files
  • Ensure index.html exists in the root

One repository equals one product.

Step 2: Enable GitHub Pages

In the repository:

  • Go to Settings → Pages
  • Source: Deploy from a branch
  • Branch: main (or master)
  • Folder: / (root)
  • Save

Wait until GitHub confirms the site is published.


Step 3: Configure the Custom Subdomain

Still in Settings → Pages:

  • Set Custom domain to: product1.example.com
  • Save

GitHub automatically creates or updates a CNAME file and starts DNS validation.


Step 4: Verify the CNAME File

In the repository root, confirm there is a file named CNAME with exactly:

product1.example.com        

No protocol. No extra whitespace.


Step 5: Add DNS Record in Hostinger

In Hostinger → Domains → DNS / Nameservers, add:

  • Type: CNAME
  • Name / Host: product
  • Points to: YOUR_GITHUB_USERNAME.github.io
  • TTL: Default

Important: For this subdomain, remove any existing A or AAAA records. GitHub Pages requires a single CNAME.


Step 6: Wait for DNS Propagation

DNS propagation usually takes:

  • 5–15 minutes
  • Up to 60 minutes in some cases

Avoid repeatedly changing settings during this time.


Step 7: Enable HTTPS

Once GitHub verifies the domain:

  • Enable Enforce HTTPS in GitHub Pages

This provides free SSL automatically.


Step 8: Verify the Site

Visit:

https://product1.example.com        

You should see:

  • The correct product site
  • HTTPS enabled
  • No certificate warnings


The Checklist I Reuse Every Time

Before debugging:

  • Custom domain set in GitHub Pages
  • CNAME file exists and is correct
  • Hostinger DNS has only one CNAME for the subdomain
  • No A or AAAA records for that subdomain
  • Waited at least 10 minutes
  • HTTPS enabled after verification


Key Takeaways

  • No need to buy additional domains
  • One product = one repository
  • Subdomains scale cleanly
  • GitHub Pages + Hostinger is a reliable combination
  • This process becomes trivial after the first setup


This setup has worked for me and keeps both the technical architecture and product branding clean as the startup grows.

If you’re building multiple products under one company, this approach is simple, repeatable, and production ready.

To view or add a comment, sign in

Others also viewed

Explore content categories