Change url path from strapi blog

I followed the steps to set up the react-next-strapi blog, and it is great:

The only thing I would like to change is the url paths. Now they are: “category” for the groups and “article” for the pages. I would like them to be “section” and “room” instead.
Is there an easy way to rename that? I don’t really mind if the postgres uses new names or old ones, as long as the end user navigates the site with the urls I want.
Thanks!

System Information
  • Strapi Version:
  • Operating System:
  • Database:
  • Node Version:
  • NPM Version:
  • Yarn Version:

@Mcastres any thoughts?

Hello!

I think that the easiest way of achieving this is to simply rename your folders in your Next.js application. Instead of having pages/article and pages/category you would have pages/section and pages/room then you’ll need to modify the internal code to get rid of your Next.js article and category logic (the pages) but keeping the requests you make with Strapi the same (/articles and /categories).

Here I consider that you only want to change article and category on the front, not in Strapi. If you want to change it in Strapi, then you would need to simply change your collection type and then your Next.js code accordingly.

1 Like

Hi! renaming the folder did the trick! and now the end user browses the urls as I intended. I guess it is a bit messy now with postresql having one naming convention and the front en another… I may try to rename that if only to keep my application clean…
For this you say I should change “collection type?” I will look up the documentation / forums to see if someone put some guide about it.
At any rate thank you very much!

1 Like