首页 > 解决方案 > how to index dynamic routes in google using nextJS

问题描述

I know how to use reactJS, but now I am creating a web page made with nextJS to improve SEO, but I have a question.

How do I make my dynamic routes made with NextJS known to google? I understand that we have getStaticPaths and in routes we can put all the routes and by setting fallback to true we can add the dynamic routes without specifying them, but how do I do when I have a million routes and I want google to index them and they can appear in the searches? Thank you very much I hope someone helps me: D

标签: reactjsroutesnext.jsseo

解决方案


You can provide a sitemap, that search engines use to define what paths your site contains. That way they know which paths to crawl through.

Googling sitemap + next.js gave this tutorial for example, but for super simple site you could just define it manually too: https://cheatcode.co/tutorials/how-to-generate-a-dynamic-sitemap-with-next-js


推荐阅读