1) Create a setup.php in your webroot (next to index.php), or at user/setup.php. Grav loads this before building the stream table, and any scheme you define here fully overrides the default:
Now media://foo.jpg resolves to user/env/<hostname>/media/foo.jpg if it exists, otherwise falls back to user/media/foo.jpg.
2) Create the per-environment folder — this is the gotcha in Grav 2.0. The environment stream only registers if the directory already exists on disk (a guard added in 2.0 to stop stray hostnames from auto-creating user/env/ dirs — see Setup.php lines \~262-274). So you must make it yourself:
TXT
user/env/mysite.com/media/
where mysite.com is the exact HTTP host. If it's not there, environment:// silently resolves to nothing and you'll only ever hit user://media.