Symfony 4 – How to make subdomain for route?

  host, php, routes, subdomain, symfony

in my symfony 4 project there are routes for which I would like a base URL different from the others.

For example, for some URLs, it will follow this plan:[route]

But for other routes, I would like something like:[route]

I looked at the doc and I saw that it was necessary to use the “host” in the annotations.

Currently I’m developing locally so my URLs look like[route]

So, for a route, by example, I have

     * Affiche la page de profil de l'utilisateur.
     * @Route("/profile", name="account_profile", host="app.")
     * @param Request $request
     * @return Response
    public function profile(Request $request)
    { // ... }

And it doesn’t work, no url found here.

Source: Symfony Questions