Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

164
Visualizações
How to add a page route with html extension on nextjs

I need to convert a non-nextjs page to nextjs. In order to not lose my SEO ranking, I have to create the route with html extension. To make the picture look better, I am adding the folder structure down below.

enter image description here

Unfortunately, this route ending up as 404 on the browser.

enter image description here

What is the problem? Am I allowed to use Next.js routes like that with html extension?

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

This naming convention search-result.html is not allowed for public sub-directories . There are some ways of showing html file in next but I'm not sure they will workcheck this

But you can easily copy everything inside your <body> tag inside your Next js project and it will work properly . How ever you have to manually add your <meta> and other head tags inside Next js built in <Head/> component .

about 4 years ago · Juan Pablo Isaza Relatório

0

You can do this via the pageExtensions option in nextJS -

I deployed a vercel app to show how this is working

https://html-ext.vercel.app/search-results.html

Steps

  1. Add the pageExtensions to next.config.js files i.e
pageExtensions: ['html', 'jsx', 'js', 'tsx', 'ts'],
  1. Rename the file under pages directory to .html.js - search-results.html.js in this case.
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda