Why does GitHub pages now show a 404 error? - github

Thanks for taking the time to read my first question.
I created an hosted a repo on GitHub assigned it to my name and committed and yesterday I could see the website.
Today it seems to have gone offline with no error and with no other change.
Any help would be massively appreciated.
Site: mylokaye.github.io
Domain: mylokaye.tech
Error:
404
There isn't a GitHub Pages site here.
If you're trying to publish one, read the full documentation to learn how to set up GitHub Pages for your repository, organization, or user account.
GitHub Status — #githubstatus

Solution
One possible solution is to ensure there is a file called CNAME on the branch your GitHub Pages site is served from, containing your custom domain name.
Root cause
When you configure a custom domain in the repo's Pages settings, GitHub generates a CNAME file and commits this to the branch or folder the site is being served from. If this file is removed, you will see a 404 page instead of your site and the custom domain configuration will be blank again.
If you are using something like Docusaurus then when a content change is made and the static site is rebuilt, the CNAME file was being wiped out.
Viewing the commit history for the branch my site was being served from (gh-pages) I saw commits which added a CNAME file to the repo root corresponding to when I configured the custom domain in the repo's Pages settings.
In the screenshot above, the commit on 2nd Jan was generated by GitHub automatically when I configured the custom domain. The commit on 3rd Jan was Docusaurus publishing a content change, which removed the CNAME file and my site returned a 404 on the custom domain url. Same thing happened on 5th Jan when I reconfigured the site and then made a content change and the GitHub Action publishing my site generated the deploy commit which removed the CNAME file again.
Fix for Docusaurus v2
My site is generated by <Docusaurus.io> and I'd missed this in the documentation where it says to create a static file in the /static folder which will be copied over to the published branch. The file contents should be a single line of text with the custom domain name eg. buildthethingright.com
For other site generators there will probably be different ways to ensure a CNAME file with a custom domain remains on the GitHub Pages branch. Note there was a different process for Docusaurus v1, so check your static site generator docs for how to do this for you.

The typical trigger for an error 404 message is when website content has been removed or moved to another URL. There are also other reasons why an error message could appear. These include:
The URL or its content (such as files or images) was either deleted or moved (without adjusting any internal links accordingly).
The URL was written incorrectly (during the creation process or a redesign), linked incorrectly, or typed into the browser incorrectly.
The server responsible for the website is not running or the connection is broken.
The requested domain name can’t be converted to an IP by the domain name system (DNS).
The entered domain name doesn’t exist (anymore).
Check this website, if you want more answer:
https://en.m.wikipedia.org/wiki/HTTP_404#Soft_404

Related

How do I serve a Github page through a custom domain when the content is stored in the docs folder?

I have a project site in Github that is served through a custom domain (rented through Google Domains). I first configured the repository to serve directly from the master branch, and configured the DNS records in Google accordingly.
Specifically, the A record is set to
185.199.108.153
185.199.109.153
185.199.110.153
185.199.111.153
and the CNAME record is set to myusername.github.io. In the Github repository, I created the CNAME file with mycustomdomain.org and changed the repository settings to use it. This works properly.
However, once I change the Github Pages setting to use the /docs folder on the master branch, I can't access the site through mycustomdomain.org. (It's a 404 error) Intuitively, it's now at mycustomdomain.org/docs. Is there any way to both serve the pages from the docs folder and access the site through the top-level domain?
Moving CNAME file from the root of the repo to the /docs folder solved the problem.
Reference: The CNAME errors are mentioned here in GitHub documents.

getting 404 github error when trying to make public page

I keep getting this error. I followed the instructions exactly.
404 There isn't a GitHub Pages site here. If you're trying to publish
one, read the full documentation to learn how to set up GitHub Pages
for your repository, organization, or user account.
I am trying to upload a simple index.html page and keep getting this error
for reference here is the page https://github.com/xrpgiftsgive/xrpgiftsgive.github.io
I downloaded the desktop client.
For testing, try and push an index.md file, as seen in "Creating your site"
In the root of the publishing source, create a new file called index.md that contains the content you want to display on the main page of your site.
Check the settings associating to your repository, to verify its publication source (which should be master for a user GitHub pages site)

404 Error on files that exist in the proper place on GitHub Pages

This is my first attempt at using GH Pages, and I have a pretty simple blog site created with Vuejs.
I've created my repo, then deployed the built code to a gh-pages branch, and the settings are pointed to that branch.
However, I get a WSOD when I try to view my site, and when I look in the console, I get a list of messages that the referenced files can't be found.
When I look in the /static directory in the gh-pages branch, though, all of the files that it says are missing are actually there where they're supposed to be in relation to index.html.
What am I missing that keeps the site from showing?
If you look into the requests, you would find out requesting
https://wonder95.github.io/static/css/app.da01b7b80b6795e91d3ceace476633af.css
This has missed the /smga/ part, and is not what published in your git pages. As the correct link should be
https://wonder95.github.io/smga/static/css/app.da01b7b80b6795e91d3ceace476633af.css

Github pages and github project sites with personal domain name

I successfully moved my blog to github pages(www.strayed-bits.net). However, I cannot access my project site: rmuktader.github.io/bootstrap
Is there a way to make custom domain name work for both github pages and github project sites? Or do I have to forget about personal domain name and stick with rmuktader.github.io?
Well, pointing to rmuktader.github.io/bootstrap leads server to look for rmuktader.github.io/bootstrap/index.html which doesn't exist.
The only thing available at this url (from your last commit) is a folder containing a starter_template folder, but no index.html at the root. So, 404 !
You can move all the starter_template content to your root an commit the changes.
This will send, you will now have your index.html at the root, and everithing will be ok.

How to set up two jekyll blogs on Github Pages with the same domain (CNAME)

I have two blogs hosted on Github Pages: travel and personal. The first should appear on http://alkamid.com/travel, the second on http://alkamid.com — and they do, but after pushing the travel CNAME with the same content as the personal one (just one line: alkamid.com), I got the following warning from Github:
The page build completed successfully, but returned the following
warning:
CNAME already taken: alkamid.com
I didn't change anything in the settings of my domain provider.
What is the correct way of configuring CNAME for these two blogs?
Remove CNAME from your /travel repository. You just need it in your username.github.io repository.
Edit : This is my point of view about CNAME on github pages (ghp)
The simplest ways to manage custom domain on ghp is to set a CNAME (pointing to example.com) on username.github.io and any project repository hosting a gh-pages branch can be naturally reached at example.com/repositoryName. This is my solution.
But you can always set another CNAME on a particular project repository, for a subdomain (sub1.example.com) or another domain (example.org). This just implies to set a custom DNS. And here it's your choice.