Best way to manage different projects on the same URL

What would be the best way to manage different projects hosted on the same URL ?

For example :

Project 1 : example.com/project1
Project 2 : example.com/project2
Project 3 : example.com/project3

That way each subdirectories is managed on it’s own project.

I want each department in my company to manage their own projects so they don’t get confused on what belongs to who.