How to rename the resource name in the URL path?

I mean how to serve this:

/entities/10

as:

/id/10?

Thank you.

If your current route is resources "/entities", EntitiesController, change it to resources "/id", EntitiesController.

But ask yourself: is id a proper description for the type of data you are fetching?

3 Likes

I simply want a short two letters name. It is publically accessed and I want the url to be short.