MT Infra Solutions

Cloudflare Pages + Custom Domain

Deploy a static site from GitHub to Cloudflare Pages and bind mtinfrasolutions.com + www with HTTPS.

Status: Draft

Scope / Objective

  • Scope: GitHub repo → Cloudflare Pages deployment, custom domain binding, Cloudflare DNS web records (apex + www).
  • Objective: Ensure https://mtinfrasolutions.com and https://www.mtinfrasolutions.com load successfully over HTTPS.
  • Non-goals: Application backend, dynamic APIs, or replacing existing mail routing/authentication records.

Dependencies / Preconditions

Accounts & Access

  • Cloudflare account with active zone mtinfrasolutions.com
  • Permissions: edit DNS records; create/manage Cloudflare Pages projects and custom domains
  • GitHub account/org access to repo (example: GIT-MT-01 / MT-WEB-01)
  • GitHub Desktop authenticated (recommended for operator workflow)

Assumptions

  • Site is static (root contains index.html)
  • Local DNS (port 53) may be blocked; DNS validation uses DoH (HTTPS/443)
  • Email DNS records (MX/SPF/DKIM/DMARC) exist and must remain unchanged

Change plan

  1. Create/update static site content in GitHub repo (index.html at repo root).
  2. Create Cloudflare Pages project from Git repository and deploy.
  3. Add custom domains in Pages: apex + www.
  4. Ensure Cloudflare DNS has required web CNAMEs (proxied) without disturbing mail records.
  5. Validate via Cloudflare UI + DoH JSON checks + browser proof.
  6. Capture evidence pack artifacts and hashes.

Implementation steps

1) Prepare repository (static site)

  1. Confirm repo exists and contains /index.html at repo root.
  2. Commit and push to main (prefer PR workflow if using governance controls).

2) Create Cloudflare Pages project (Git-connected)

  1. Cloudflare Dashboard → Workers & PagesPagesCreate applicationConnect to Git.
  2. Select the repo (GIT-MT-01 / MT-WEB-01).
  3. Set build config:
    • Production branch: main
    • Framework preset: None
    • Build command: (blank)
    • Build output directory: .
  4. Click Save and Deploy.

3) Bind custom domains in Pages

  1. Pages Project → Custom domainsSet up a custom domain.
  2. Add apex: mtinfrasolutions.com → proceed.
  3. Add www: www.mtinfrasolutions.com → proceed.
  4. If Cloudflare requests DNS changes, apply them (see DNS mapping below).
  5. Wait until both domains show Active with SSL enabled.

4) Confirm Cloudflare DNS records (authoritative zone)

Required web records (example):

  • CNAME @ → mt-web-01.pages.dev (Proxied, TTL Auto)
  • CNAME www → mt-web-01.pages.dev (Proxied, TTL Auto)

Note: Cloudflare supports apex CNAME via CNAME-flattening.

  1. Cloudflare zone mtinfrasolutions.comDNSRecords.
  2. Verify the two web records exist and are proxied. Do not modify Proton Mail records.

5) Optional: redirect www → apex (canonical host)

  1. Cloudflare zone → RulesRedirect Rules → Create rule.
  2. Match: Hostname equals www.mtinfrasolutions.com
  3. Redirect: https://mtinfrasolutions.com/$1 (301)

Validation (with exact commands)

A) Cloudflare UI

B) External DNS checks via DoH (PowerShell)

$domain   = "mtinfrasolutions.com"
$BasePath = "$env:USERPROFILE\Documents\MTINFRA-EvidencePack"

# Apex A (post)
$Apost = Invoke-RestMethod -Uri ("https://cloudflare-dns.com/dns-query?name=$domain&type=A") -Headers @{ accept="application/dns-json" }
$Apost | ConvertTo-Json -Depth 10 | Out-File (Join-Path $BasePath "EV-41-A-DoH-Post.json") -Encoding utf8

# www CNAME (post)
$WWWpost = Invoke-RestMethod -Uri ("https://cloudflare-dns.com/dns-query?name=www.$domain&type=CNAME") -Headers @{ accept="application/dns-json" }
$WWWpost | ConvertTo-Json -Depth 10 | Out-File (Join-Path $BasePath "EV-42-WWW-CNAME-DoH-Post.json") -Encoding utf8

C) HTTP HEAD checks (PowerShell)

Invoke-WebRequest -Uri "https://mtinfrasolutions.com" -Method Head | Select-Object -ExpandProperty StatusCode
Invoke-WebRequest -Uri "https://www.mtinfrasolutions.com" -Method Head | Select-Object -ExpandProperty StatusCode

D) Browser proof

Rollback plan

  1. Cloudflare Pages → Project → Custom domains: remove www and apex domain bindings.
  2. Cloudflare zone → DNS → Records: remove web CNAMEs:
    • CNAME @ → mt-web-01.pages.dev
    • CNAME www → mt-web-01.pages.dev
  3. Confirm Proton Mail records still exist (MX/SPF/DKIM/DMARC).
  4. Validate: DoH queries should no longer resolve web hostnames; mail should remain functional.

Evidence pack checklist

Evidence IDArtifactWhat it proves
EV-CF-04EV-CF-04-DeploymentSuccess.pngPages deploy succeeded
EV-CF-05EV-CF-05-DNS-WebRecords.pngApex + www DNS web records exist; mail records intact
EV-CF-06-07EV-CF-06-07-CustomDomains-Active.pngApex + www are Active; SSL enabled
EV-41EV-41-A-DoH-Post.jsonPost-change apex resolves externally
EV-42EV-42-WWW-CNAME-DoH-Post.jsonPost-change www resolves externally
EV-V3EV-V3-Browser-WebLive.pngBrowser proof of reachability
EV-00EV-00-Hashes-SHA256.txtIntegrity hashes for JSON evidence

Final state

  • Cloudflare Pages project deployed and serving content
  • Custom domains mtinfrasolutions.com and www.mtinfrasolutions.com show Active + SSL enabled
  • Cloudflare DNS contains web CNAME records to mt-web-01.pages.dev (proxied)
  • Email DNS records preserved (Proton Mail)