Guide: Troubleshooting 404 errors for GitHub Pages sites #61073
Replies: 11 comments 9 replies
-
Thank you |
Beta Was this translation helpful? Give feedback.
-
When you encounter a 404 error on your GitHub Pages site, it usually means that the server couldn't find the requested page. This can happen for a few reasons, but don't worry, we'll work through them step by step. Here's a guide to help you troubleshoot those pesky 404 errors: Check Your File Paths: The first thing to do is make sure your file paths are correct. Double-check that you've specified the right file names and folder locations in your URLs and links. Remember, GitHub Pages is case-sensitive, so "Page.html" and "page.html" are considered different files. Branch and Directory Settings: If your site isn't showing up, make sure that the branch you're using for GitHub Pages is correct. Also, confirm that your site's main HTML file (like "index.html") is in the root directory of your repository. Wait for Changes to Reflect: If you've recently made changes to your site, remember that it might take a little time for those changes to be visible due to caching. Give it a bit of time, or try clearing your browser cache. GitHub Pages Build: Sometimes, a 404 error might be caused by a problem during the GitHub Pages build process. Make sure your repository has been successfully built. You can check the "Settings" tab in your repository for GitHub Pages build logs. Link Errors: If you're linking to external resources like CSS, JavaScript, or images, ensure that the URLs are correct. An incorrect link could lead to a 404 error. File Extensions: GitHub Pages often assumes that files like "Page.html" should be accessed as "page.html". Check if your file extensions and URLs are consistent. Repository Permissions: Ensure that your repository is public if you intend for your GitHub Pages site to be accessible to everyone. Private repositories won't be visible to the public. Custom Domain: If you're using a custom domain, make sure your DNS settings are properly configured. Incorrect settings could lead to 404 errors. Typos in URLs: It's easy to overlook typos in URLs. Make sure there are no typos in your links and URLs that could be causing the issue. GitHub Status: Occasionally, GitHub itself might experience issues that can result in temporary disruptions. You can check the GitHub Status page to see if there are any ongoing problems. By following these steps, you should be able to narrow down the cause of the 404 error on your GitHub Pages site and get it back up and running smoothly. |
Beta Was this translation helpful? Give feedback.
-
Please add another reason is that your folders may start with Credit to mpetrovich/stylemark#65. |
Beta Was this translation helpful? Give feedback.
-
I would suggest to add that if you are using Jekyll, you must know that by default files and directories that start with "_" will be ignored. |
Beta Was this translation helpful? Give feedback.
-
I'm trying to deploy a web page with react and vite, I've followed all the steps you mentioned before but I still have a 404 response :/ |
Beta Was this translation helpful? Give feedback.
-
github.com/user |
Beta Was this translation helpful? Give feedback.
-
Hello everyone My repository is there: Could you help me please? |
Beta Was this translation helpful? Give feedback.
-
It's not working! It's driving me crazy! *Simple workflow for deploying static content to GitHub Pages on:
jobs:
I don't know, but it says I don't have the rights to change some things... Error: .github#L1 IM THE ... OWNER!!! What's happen? Now, I'm utilizing the old version I had stored. However, when attempting to operate with version v4, it feels like colliding my head against the hard wall of reality, as it simply doesn't function. use this! name: Deploy to GitHub Pages on: jobs:
Please fix this fast! it's the worst for newbies :( |
Beta Was this translation helpful? Give feedback.
-
I am getting a 404 error about my page not being found. It has been working for quite a while and I haven't made any updates to my page since 5 months ago and it all of a sudden stopped working. Has something change in the last few months with the structure? |
Beta Was this translation helpful? Give feedback.
-
Hi, can you add a guide about |
Beta Was this translation helpful? Give feedback.
-
Getting the dreaded 404 error while building a GitHub Page is no fun 👎 and can often be confusing as you work to set up your site. We’ve compiled common reasons you may be seeing the 404 error while working with GitHub Pages. This guide will help you troubleshoot common reasons you may be seeing this 404 error and also lives in our docs!
Troubleshooting 404 errors
GitHub's Status page
If you see a 404 error while building a GitHub Pages site, first check GitHub's Status page for any active incidents.
DNS setup
Make sure GitHub's DNS records are set up correctly with your DNS provider. For more information, see Managing a custom domain for your Pages site or search in the community.
Browser cache
If your Pages site is private and you see a 404 error, you may need to clear your browser's cache. For more information on clearing your cache, see your browser's documentation.
index.html
fileGitHub will look for an
index.html
file as the entry file for your site.Make sure you have an
index.html
file in the repository for your site on GitHub. For more information, see Creating a GitHub Pages site](https://docs.github.com/en/pages/getting-started-with-github-pages/creating-a-github-pages-site#creating-your-site).The entry file must be at the top level of your chosen publishing source. For example, if your publishing source is the
/docs
directory on themain
branch, your entry file must be located in the/docs
directory on a branch calledmain
.If your publishing source is a branch and directory, the entry file must be at the top level of the source directory on the source branch. For example, if your publishing source is the
/docs
directory on themain
branch, your entry file must be located in the/docs
directory on a branch calledmain
.If your publishing source is a GitHub Actions workflow, the artifact that you deploy must include the entry file at the top level of the artifact. Instead of adding the entry file to your repository, you may choose to have your GitHub Actions workflow generate your entry file when the workflow runs.
The name of the
index.html
file is case sensitive. For example,Index.html
will not work.The name of the file should be
index.html
, notindex.HTML
or any other variation.Directory contents
Check that your directory contents are in the root directory.
Custom domain
If you're using a custom domain, make sure it's set up correctly. For more information, see About custom domains and GitHub Pages.
CNAME
record should always point to<USER>.github.io
or<ORGANIZATION>.github.io
, excluding the repository name.Repository
Check whether your repository meets the following requirements.
main
or default branch.Now that you have this guide, feel free to use it to assist in solving other members’ posts in the GitHub Community and spread the knowledge wealth 🧠.
Still receiving a 404 error? Start a discussion and share as many details as you can.
Are we missing any common blockers or you want to see more guides like this? Let us know in the comments!
Beta Was this translation helpful? Give feedback.
All reactions