0

I recently deployed a reactjs website on github pages using the custom domain -https://titanmarket.co.ke/.

The website works as expected but returns a 404 error when you reload a page. Usually, a user would expect the current page to be displayed on refresh.

Any insight on this would be great.

Gatsby
  • 38
  • 5

2 Answers2

0

This may answer your question link Reference, Also see this

Shmili Breuer
  • 3,927
  • 2
  • 17
  • 26
0

Super easy solution for Github pages reload 404 error.

  1. in the src/public/ index.js file add this script below to the bottom body:

Index.js https://github.com/rafgraph/spa-github-pages/blob/gh-pages/index.html

  1. Create a 404.html file in the root directory:

404.html https://github.com/rafgraph/spa-github-pages/blob/gh-pages/404.html

Read more:

Source: https://github.com/rafgraph/spa-github-pages

Kafka
  • 98
  • 6