Contact, if you are interested in this website / domain name / Sponsorship / Advertisement / Partnership
HomeLearnToolsRoadmapVideosBuildSponsorshipAboutContactStart a project
Beginner

Deploying a Static Site: From Folder to Live URL

9 minute read · Last updated 2026-10-31 · Written and reviewed by the Code.House editorial team

A static site is a folder of files a server hands over unchanged. There is no application process to crash and no database to breach, which is why static hosting is cheap, fast and unusually reliable.

What static hosting does

The host puts your files on a content delivery network — a set of servers spread around the world — and serves the copy nearest each visitor. Because no code runs per request, the response is close to instant and cost is close to zero. Anything dynamic (forms, payments, search) is added through a third-party service or a small serverless function.

Deploying with GitHub Pages

  1. Push your files to a repository with index.html in the root.
  2. Open Settings → Pages.
  3. Under Source choose Deploy from a branch, pick main and the / (root) folder, then save.
  4. Wait about a minute. The site appears at https://username.github.io/repository/.

Two details save an afternoon. Add an empty .nojekyll file so folders beginning with an underscore are published. And remember the site is served from a subfolder, so root-relative links such as /about.html break — use relative paths, or set a base path in your build tool.

Alternatives worth knowing

HostStrengths
Cloudflare PagesGenerous free tier, fast global network, simple functions
NetlifyForm handling, redirects, deploy previews
VercelStrong framework integration, preview deployments
Object storage plus CDNLowest cost at large scale, most setup

All of them deploy on a push to your repository, so moving between them later is mostly a DNS change.

Connecting a custom domain

Point the apex domain at the host with A records (or ALIAS/ANAME where supported) and the www subdomain with a CNAME. For GitHub Pages, add a file named CNAME containing only the domain, then enter the domain in the Pages settings and enable Enforce HTTPS once the certificate has been issued. DNS changes usually take minutes, occasionally hours.

Pick one canonical hostname — with or without www — and redirect the other to it, so search engines and analytics do not treat them as two sites.

The post-launch checklist

  • Every page loads over HTTPS with no mixed-content warnings.
  • robots.txt and sitemap.xml exist, and the sitemap lists real URLs.
  • The site is verified in Google Search Console and the sitemap is submitted.
  • A custom 404 page exists and links back into the site.
  • Titles and meta descriptions are unique on every page.
  • It renders correctly at 320 pixels wide with no horizontal scrolling.
  • Core Web Vitals measured on a throttled mobile connection, not just desktop.

Common questions

Can a static site have a contact form?

Yes. Use a form service, a serverless function, or a mailto link that opens the visitor's email client. None of them require a server you maintain.

How do I add search?

A build-time index such as Pagefind or Lunr runs entirely in the browser and is adequate up to a few thousand pages. Beyond that, a hosted search service is simpler.

Keep reading

Spotted something out of date? Send a correction — guides are revised rather than quietly deleted.