-
Select Topic AreaGeneral BodyHi All, So I have my portfolio website hosted on GitHub pages. Here is the repository: https://github.com/aadictive/aadictive.github.io Now when I click on the pages or tabs on my portfolio it takes me to the proper URL and displays the correct results. But when I refresh, I get a blank page or a 404 Not Found page. For example https://adityachaudhari.dev/about or https://adityachaudhari.dev/project I recently added another repository called test-app as I wish to add a few project repositories to my website. It opens up at https://adityachaudhari.dev/test-app I am not able to resolve the issue with 404 for my I see a similar Issue for a month-old discussion: here |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 7 replies
-
Check your routing configuration: Review your website's routing configuration to ensure that it is correctly handling requests for the /about, /project, and /resume pages. Make sure that the routing rules are not conflicting with the new repository names. Check your file names and paths: Make sure that the files for the /about, /project, and /resume pages exist and are located in the correct directories. Check the file names and paths to ensure that they match the routing configuration.
|
Beta Was this translation helpful? Give feedback.
-
I think I found the solution. For my project, all the relative links that have the repository name in them can route properly. I might have to do some additional settings with custom domain configs. Now if you find the repeating repository name in the first scenario like |
Beta Was this translation helpful? Give feedback.
-
To wrap this thread up! I found the solution to my problem in the comment in a separate discussion. This solution is a temporary fix, but it worked like a charm! FYI, the routing issue is a known issue in GitHub pages! So first you will need to add a new page named 404.html to your repo.
If you are not using a custom domain on GitHub Pages set pathSegmentsToKeep = 0, otherwise set pathSegmentsToKeep = 1. Copy this script and add to your index.html.
On your build folder need to have this file 404.html, and thats is it. |
Beta Was this translation helpful? Give feedback.
To wrap this thread up!
I found the solution to my problem in the comment in a separate discussion. This solution is a temporary fix, but it worked like a charm!
FYI, the routing issue is a known issue in GitHub pages!
So first you will need to add a new page named 404.html to your repo.