FixThatApp

GitHub Pages Not Loading: 7 Fixes for 404s, DNS & Build Errors (2026)

Last updated: May 9, 2026 · Verified against current GitHub Actions deployment flow

You push changes to your GitHub repository and navigate to your github.io URL — only to be greeted by a 404 page, a blank white screen, or content that hasn't updated since your last push. Maybe your custom domain suddenly shows "This site can't be reached", or your GitHub Actions workflow shows red and you have no idea why the build failed. GitHub Pages is deceptively simple to set up but has several specific failure points that aren't obvious from the interface.

The good news is that nearly every GitHub Pages problem falls into one of seven categories, and most are fixable in under five minutes once you know where to look. This guide walks through each scenario in the most likely order you'll encounter them.

Quick Diagnosis: What Symptom Do You Have?

404 error on your github.io URL → Pages is likely not enabled or the source branch is wrong. Start with Fix 1.

Custom domain shows "not found" or "can't be reached" → DNS misconfiguration or missing CNAME file. See Fix 3 and Fix 4.

Site loads but shows old content after a push → Deployment may be stuck or failed. Check Fix 2 and try Fix 7.

HTTPS shows a certificate warning → Certificate not yet provisioned after custom domain setup. Wait up to 24 hours.

GitHub Actions shows a red X on deployment → Jekyll build error or configuration issue. See Fix 2 and Fix 5.

Site works for you but not for others → DNS propagation still in progress — normal within 48 hours of domain changes.

7 Fixes for GitHub Pages Not Loading

Fix 1: Check Repository Settings — Is Pages Actually Enabled?

Why this matters: GitHub Pages is not automatically enabled on new repositories. You must explicitly turn it on and configure which branch to deploy from. If you haven't done this, or if the settings got reset, your site simply won't exist at the github.io URL.

  1. Navigate to your repository on GitHub.com.
  2. Click the Settings tab at the top of the repository.
  3. In the left sidebar, click Pages under the "Code and automation" section.
  4. Under "Build and deployment", confirm the Source is set to your correct branch (usually main or gh-pages) and folder (usually / (root) or /docs).
  5. If Pages was not enabled, set it up now. GitHub will begin building and display your URL when complete.
  6. If it says "Your site is live at..." but still shows 404, confirm the branch contains an index.html at the exact path you selected.

A very common mistake is deploying from the main branch root but having your HTML files inside a subdirectory. GitHub Pages serves exactly what is in the selected folder — your index.html must be directly there, not nested deeper inside another folder.

Fix 2: Check GitHub Actions Deployment Logs for Build Errors

Why this matters: Modern GitHub Pages deployments use GitHub Actions workflows. When a build fails, your old site stays visible (or nothing shows at all for new repos), giving you no obvious indication something went wrong. The failure details are in the Actions tab.

  1. Go to your repository and click the Actions tab.
  2. Look at the most recent workflow run. A red circle means it failed; yellow means it is in progress; green means success.
  3. Click into the failed run and expand the build steps to read the error message.
  4. Common errors include: missing Jekyll dependency, YAML syntax error in _config.yml, a Liquid template error in an HTML file, or a missing file referenced in the config.
  5. Fix the underlying issue in your repository, push again, and watch the Actions tab for the new run.

If you see no workflow runs at all, your repository may be using the older "Deploy from a branch" method rather than Actions. In that case, look for a build status indicator on the Settings › Pages screen itself.

Fix 3: Wait for DNS Propagation After a Custom Domain Change

Why this matters: DNS records do not update instantly across the internet. When you change or add a custom domain, the old DNS records remain cached at ISPs and resolvers worldwide. Full propagation can take anywhere from a few minutes to 48 hours depending on the previous TTL (time-to-live) of your records.

To check propagation status, visit whatsmydns.net and enter your domain. It shows which DNS servers around the world have picked up the new records. For a GitHub Pages custom domain, your DNS records should point as follows:

If whatsmydns shows your records are globally updated but the site still fails to load, the problem is configuration rather than timing — move on to Fix 4.

Fix 4: Verify the CNAME File Is in Your Repository Root

Why this matters: When you configure a custom domain in GitHub Pages settings, GitHub automatically creates a file called CNAME in your repository root. This file must exist and contain exactly your custom domain. If it gets deleted — for example by a git push that overwrites it — your custom domain stops working immediately.

  1. Browse your repository's file list on GitHub.com.
  2. Look for a file named CNAME (no extension, all caps) at the root level.
  3. Click it and confirm it contains your custom domain on a single line — for example: www.yourdomain.com.
  4. If the CNAME file is missing, go to Settings › Pages and re-enter your custom domain. GitHub will recreate the file automatically.
  5. If your build process deletes the CNAME file on each deploy (common with static site generators outputting to a /dist folder), configure your build to copy the CNAME file as a build artifact before deployment.

Fix 5: Check _config.yml for Syntax Errors

Why this matters: If your GitHub Pages site uses Jekyll (which it does by default unless you include a .nojekyll file), the _config.yml file is parsed on every deployment. A single YAML syntax error — a misplaced colon, inconsistent indentation, or an unclosed quote — causes the entire build to fail.

  1. Open _config.yml in your repository.
  2. Check for: tabs instead of spaces for indentation, missing space after a colon (write key: value not key:value), special characters in strings that need quoting, and an incorrect baseurl setting.
  3. If your site is at yourusername.github.io/repo-name, your baseurl must be /repo-name. If it is at yourusername.github.io (user or org site), baseurl should be empty.
  4. Validate your YAML at yamllint.com before pushing.
  5. If you do not need Jekyll processing at all, add an empty file called .nojekyll to your repo root to skip the Jekyll build entirely and serve your files directly.

Fix 6: Make the Repository Public or Check Your GitHub Plan

Why this matters: GitHub Pages for free accounts only works with public repositories. If your repository is private and you are on a free GitHub plan, Pages will not be available — the option will be grayed out in settings or the site will not load for visitors.

  1. Go to your repository Settings › General and scroll to the "Danger Zone" at the bottom.
  2. Check whether the repository is set to Private.
  3. If you need to keep it private, you will need GitHub Pro, GitHub Team, or GitHub Enterprise to use Pages with private repositories.
  4. If making the repo public is acceptable, click "Change visibility" and set it to Public.
  5. After changing to public, re-enable Pages in Settings › Pages if it had been previously unavailable.

Fix 7: Force a Redeploy by Pushing an Empty Commit

Why this matters: Sometimes GitHub Pages gets stuck and has not run a fresh build despite your pushes completing successfully. This can happen after GitHub infrastructure issues or when the last deployment partially completed. Pushing any commit — even an empty one with no file changes — triggers a fresh build cycle.

  1. Open your terminal and navigate to your local repository folder.
  2. Run: git commit --allow-empty -m "Force redeploy"
  3. Then run: git push origin main (replace main with your branch name if different).
  4. Go to the Actions tab on GitHub and watch the deployment progress in real time.
  5. Once the workflow shows a green checkmark, wait 1 to 2 minutes and visit your site URL with a hard refresh (Ctrl+Shift+R on Windows, Cmd+Shift+R on Mac).

If you are not using git locally, you can trigger the same effect by making any trivial edit to a file directly on GitHub.com through the web interface and committing it there.

Specific GitHub Pages Error Messages Decoded

If you're seeing one of GitHub's specific error strings rather than a generic failure, the wording maps directly to the cause. Here's what each one actually means.

"There isn't a GitHub Pages site here."

You typed your username.github.io URL and got a 404 page with this exact heading. It means GitHub itself is responding (so DNS is fine), but the repository it expected to serve doesn't have Pages enabled or doesn't exist with that exact name.

For a user site, the repo must be named username.github.io precisely. Capitals matter on the URL but the repo name itself must be lowercase. For a project site, you accessed username.github.io/repo but that repo doesn't have Pages turned on. Open the repo's Settings › Pages and pick a source branch.

"Your site is live at..." does not appear in Pages settings

You enabled Pages, picked a branch, but the green confirmation banner with your URL never shows up. This is almost always a build failure that GitHub doesn't surface clearly on the Pages settings page itself. Open the Actions tab and look for a red workflow run from the last few minutes. The actual error is in the build logs, not on the Pages screen.

The other reason: you picked a branch that doesn't actually contain an index.html at the source path you selected. GitHub will accept the configuration but won't show a live URL until there's something to serve.

"DNS check unsuccessful" / "Domain does not resolve to the GitHub Pages server"

You added a custom domain in Pages settings and got one of these red warnings. GitHub is doing a live DNS lookup against your domain and not seeing the records it expects. Three things can be wrong:

  1. You haven't added the DNS records yet at your registrar. For an apex domain, four A records pointing to 185.199.108.153, 185.199.109.153, 185.199.110.153, 185.199.111.153. For a www subdomain, one CNAME pointing to username.github.io.
  2. You added them but they haven't propagated yet. Run dig yourdomain.com in a terminal or check whatsmydns.net. If your local resolver shows the right IPs but other regions don't, give it 1-24 hours.
  3. You have AAAA records (IPv6) pointing to old or wrong addresses. GitHub Pages doesn't currently advertise IPv6, so any AAAA records you have leftover from a previous host can cause the DNS check to fail in some regions while passing in others. Delete them.

Click the "Check again" button on the Pages settings after each DNS change rather than waiting for GitHub to retry on its own schedule.

"NotServedByPagesError"

This appears in your GitHub Actions deployment logs when the build succeeded but GitHub couldn't actually publish the artifact to its Pages CDN. It usually means your repository is private but you're on a free plan, or your workflow is using actions/deploy-pages without the right permissions block.

Open your workflow YAML and confirm it has:

If you copied your workflow from an older example, the deploy step changed in late 2022 to require these. Older Action workflows that pushed directly to a gh-pages branch still work, but the official deploy-pages path needs the explicit permissions.

"Page build failure" email from GitHub

GitHub emails the repo owner when a Jekyll build fails. The email subject is usually "Page build failure" and the body lists the offending file and line. Most common causes I've actually seen:

If you don't actually use Jekyll and just want plain HTML served, drop a zero-byte file named .nojekyll at the root of your branch. GitHub skips Jekyll entirely and serves your files raw. This eliminates an entire category of build failures.

"404 - File not found" on a specific page (but the home page works)

Your site loads but clicking an internal link takes you to GitHub's 404 page. Two common causes:

You can ship a custom 404.html file at the root to replace GitHub's default 404 page with something on-brand.

White screen / blank page (no 404, just nothing)

The page returns 200 OK but renders empty. Open your browser's DevTools console (F12) and check for JavaScript or asset 404s. The usual suspects:

HTTPS certificate not provisioning after custom domain

Your site loads on HTTP but you get a certificate warning on HTTPS, or the "Enforce HTTPS" checkbox stays disabled in Pages settings. GitHub uses Let's Encrypt and provisions the cert only after DNS fully resolves. Common gotcha: a Cloudflare proxy in front of your domain blocks the validation. If you use Cloudflare, set the DNS record to "DNS only" (gray cloud, not orange) until the cert issues, then you can re-enable proxying with Cloudflare's own SSL.

Provisioning takes anywhere from a few minutes to 24 hours. If "Enforce HTTPS" is still grayed out after 48 hours, remove the custom domain from Pages settings, save, then re-add it. This forces GitHub to retry the certificate request.

What NOT to Do

Common mistakes that make this worse
  • Don't push fixes and check the live site within 30 seconds. GitHub Pages deployments take 1-5 minutes to build and propagate after a push. Checking immediately after a commit will almost always show the old version. Wait for the Actions workflow to show a green checkmark before concluding your change didn't work.
  • Don't assume a 404 error means your files are missing. The most common cause of a 404 on GitHub Pages is that the publishing source branch or folder is misconfigured in repository settings. Check Settings → Pages to confirm GitHub Pages is pointing at the correct branch (main or gh-pages) and the correct folder (root or /docs) before assuming you need to re-upload files.
  • Don't name your main HTML file anything other than index.html at the root. GitHub Pages serves index.html as the default document for a directory. If your main file is named home.html, landing.html, or anything else, visiting your site's root URL returns a 404 even when the file is correctly present in the repository. The file must be named index.html exactly.
  • Don't use absolute paths for internal links and assets in a project subdirectory site. If your GitHub Pages site is at username.github.io/reponame, absolute paths like /style.css will fail — they resolve to username.github.io/style.css instead of the correct subdirectory path. Use relative paths or the Jekyll baseurl setting to handle this correctly.

Frequently Asked Questions

Q: How long does GitHub Pages take to deploy?

A: GitHub Pages typically deploys within 1 to 3 minutes for simple static sites. Jekyll builds and custom Actions workflows can take up to 10 minutes. If your deployment has not completed after 20 minutes, check the Actions tab for a failed workflow run. First-time HTTPS certificates for custom domains can take up to 24 hours to issue after DNS propagation completes.

Q: Can I use a custom domain with GitHub Pages for free?

A: Yes. Custom domains are fully supported on free GitHub accounts as long as the repository is public. You need to own the domain, configure DNS records pointing to GitHub's servers, and add a CNAME file to your repository root. GitHub handles HTTPS certificate provisioning automatically at no cost through Let's Encrypt.

Q: Why is my GitHub Pages site showing old content?

A: Old content after a push almost always means your browser has cached the previous version. Try a hard refresh (Ctrl+Shift+R or Cmd+Shift+R) or open the site in an incognito window. If content is genuinely stale after that, check the Actions tab to confirm the latest deployment completed successfully — a failed build leaves the old site in place.

Q: Does GitHub Pages support HTTPS automatically?

A: Yes. GitHub Pages provides automatic HTTPS for both github.io subdomains and custom domains. For github.io URLs it is active immediately with no configuration needed. For custom domains, GitHub provisions a free Let's Encrypt certificate automatically once your DNS records have correctly propagated — this can take up to 24 hours after initial custom domain setup.

Q: Can GitHub Pages run server-side code?

A: No. GitHub Pages is a static file hosting service only — it serves HTML, CSS, JavaScript, and static assets. There is no support for PHP, Python, Node.js, databases, or any server-side execution. If your project needs a backend, you must host it separately on a service like Render, Railway, or a VPS, and call it from your GitHub Pages frontend using JavaScript API requests.

Still Stuck?

If you have worked through all seven fixes and your GitHub Pages site still will not load, the official GitHub Pages documentation has detailed troubleshooting for advanced scenarios: docs.github.com/en/pages. The GitHub Community forums are also a good resource for repository-specific build failures.

Related Guides