Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

416
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda