• Empleos
  • Sobre nosotros
  • profesionales
    • Inicio
    • Empleos
    • Cursos y retos
  • empresas
    • Inicio
    • Publicar vacante
    • Nuestro proceso
    • Precios
    • Evaluaciones
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

344
Vistas
React Router Error: Not able to load different urls separately other than home page by build on Netlify

I'm a little new to react, so I have come across a problem which is on my personal portfolio website and i don't know how to solve it

the problem is when i open my website it take me to my home page which is fine, and when i go to other pages from my home page it works fine but when i want to go to about page directly than i'm unable to access it.

for example

https://sparsh-saxena.netlify.app/ this is my home page, if I type this as url it works fine

but If I want to open my about page or any other page on my portfolio than It doesn't work like: https://sparsh-saxena.netlify.app/about

It shows-> Page Not Found Looks like you've followed a broken link or entered a URL that doesn't exist on this site.

Any help would be appreciated

about 3 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

In order to support client-side routing with Netlify (which is you actual objective here). You need to support pushState.

To do this you need to create a public/_redirects file with the following rewrite rules:

/* /index.html 200

Now when you build your project for deployment it should work correctly!

TL;DR:

  • create a _redirects file in your public folder of your React Project
  • give it the following content: /* /index.html 200
  • build your project
  • deploy it to Netlify
about 3 years ago · Juan Pablo Isaza 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 Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recomiéndame algunas ofertas
Necesito ayuda