In two Symfony 4 instances, I get different results with the same code. In a twig template, I have the line
<img src="{{ asset('images/DM_logo.jpg')}}"/>
In the online server, all works well: i get the image and the generated URL is /images/DM_logo.jpg for the absolute URL http://mysite.mydomain.com/images/DM_logo.jpg
But, locally, with the access to http://localhost/mysite/, the generated url is /mysite/images/DM_logo.jpg for the absolute url http://localhost/mysite/images/DM_logo.jpg which generate a NotFoundHttpException.
If i change the template to
<img src="{{ asset('public/images/DM_logo.jpg')}}"/>
it works locally but not online...
I doesn't find how to use the same code online and locally. Advices?