-1

I'm trying to make a page on gh pages and it works with regular routes, but when there is something like this github.io/solutions/id=1 , where there is an id, then immediately 404 error

export enum Routes {
    Home = '/',
    Solutions = '/solutions',
    Elements = '/elements',
    Blog = '/blog',
    Contacts = '/contacts',
    Services = '/services',
    AboutUs = '/about-us',
    OurTeam = '/our-team',
    OurTeamSingle = '/our-team/:id',
    FAQs = '/faqs',
    SolutionSingle = '/solutions/:id',
    ServiceSingle = '/services/:id'
}
import { Routes, Route } from 'react-router-dom'

import { Routes as PathRoute } from 'enums'

const Home = lazy(() => import('pages/Home'))
...

const ContentRoutes: FC = () => (
  <Routes>
    <Route path={PathRoute.Home} element={<Home />} />
    <Route
      path={PathRoute.Services}
      element={<Services />}
    />
   ...
  </Routes>
)

How can I fix this ?

qwfrjk
  • 71
  • 2
  • 10

1 Answers1

-1

Github pages doesn't bode well with client-side routing. I would recommend looking at create-react-app's section on solutions for client-side routing when using Github pages.

tuckermassad
  • 126
  • 4