0

I have some dynamic urls in nextjs project. Our requirement is to add trailing slash in some urls. How can we do this?

Actually, we are migrating django website in nextjs. In django, we have mixed urls so we can't change the trailing slash as it will affect the seo performance of the page.

I have tried nextjs config setting by using 'trailingSlash=True/false', but it will append/remove slash in all urls of the project. I have also tried with 'trailingSlash=undefined' but this one is giving 308 redirect.

I need urls like:

/blogs/<blog-slug>/        (with trailing-slash)
/blogs/<blog-slug>-jobs    (without trailing-slash)
/blogs/<blog-slug>-career  (without trailing-slash)
juliomalves
  • 42,130
  • 20
  • 150
  • 146

0 Answers0