Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

409
Views
React Router v6 - Direct links to a subpage return a 404 error

For my wedding, I've created a small React app to provide guidance to the guests: https://louis-et-marianne.com/

Accessing my 2nd page https://louis-et-marianne.com/dormir only works from the homepage, but I get a 404 when accessing this page URL directly.

Any ideas?

Here is my App.js code where the routes are defined:

function App() {
  return (
    <div className="App">
      <Wrapper>
        <ThemeProvider theme={customTheme}>
          <CssBaseline enableColorScheme />
          <Link to="/" style={{ textDecoration: "none" }}>
            <Hero />
          </Link>
          <Container maxWidth="md">
            <Routes>
              <Route path="/" element={<Accueil />} />
              <Route path="/dormir" element={<Dormir />} />
              <Route path="*" element={<h1>Page not found.</h1>} />
            </Routes>
            <Box
              display="flex"
              alignItems="center"
              justifyContent="center"
              mt={6} mb={6}
              sx={{ transform: "rotate(13deg)" }}
            >
              <img src={betise} alt="Bétise de Cambray" width="100px" />
            </Box>
          </Container>
        </ThemeProvider>
      </Wrapper>
    </div>
  );
}

And here is the full project on Github: https://github.com/byloupom/l-et-m

Thanks!

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

its not a react js issue it has to do with the hosting provider not redirecting all the requests to the index.html file if this is hosted on github pages i dont think it supports this.

you can read it here https://github.com/isaacs/github/issues/408

about 4 years ago · Santiago Gelvez Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!