How can I create a task to run the URL to the current file
<p>I am using vscode to do some light php programming. I want to be able to create a task that will open the URL to the current file (which is served from my local webserver). </p>

<p>Here is the contents of my tasks.json file:</p>

<pre><code>{
    "version": "0.1.0",
    "command": "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe",
    "isShellCommand": false,
    "showOutput": "silent",
    "args": ["localhost/PhpProject1/${fileBasename}"]
}
</code></pre>

<p>This works fine for any file located in the document root. However this won't work if the file is located in sub-directories under the document root. Is there any way to make this work for any file?</p>

<p>I have a feeling there is no solution to my answer because vscode doesn't really no where the document root is so it doesn't know how to get the relative path. But I'm hoping there is some kind of configuration that will make it do what I want.</p>

<p>Thanks.</p>