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

257
Vistas
NextJS index and endpoint share the same page

I have few pages in my Next.js application, and i would like that going into http://localhost:3000/someEndpoint would be exactly the same component loaded as http://localhost:3000/

I already have created index.js file, but i dont know how can make some virtual URL?

Redirections are not the options, cause i would like to remain "/" endpoint also possible.

Is there any way to accomplish this?

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

0

You can use nextjs rewrites, which works as a URL masking for any URL.

module.exports = {
  async rewrites() {
    return [
      {
        source: '/someEndpoint',
        destination: '/',
      },
    ]
  },
}

So now every request on http://localhost:3000/someEndpoint will lands the user to http://localhost:3000/ without redirection. It will work as a proxy url

about 4 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 Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda