I think this is determined by what version selector is targeted by the 'vsweb' protocol handler, i.e. it's a setting on your machine.
It seems like when VS2017 installs it doesn't always set the version selector to the 2017 version (which defaults to opening VS2017), rather than an old version.
This is set in the registry at HKLM\SOFTWARE\Classes\vsweb\Shell\Open\Command
. The value will most likely be set to an older version, for example:
"C:\Program Files (x86)\Common Files\Microsoft Shared\MSEnv\VSWebLauncher.exe" /openuri "%1"
Update it to be:
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VSWebLauncher.exe" /openuri "%1"
Obviously check the paths are correct before changing them, those are the ones from my machine.
It's always worth keeping a copy of the old value so you can put it back in if something goes wrong.