Cater for subfolder installs in request

Looking at this locally it wasn't working and remembered I was in a subfolder so needed to add a reference to the subfolder in the request url.
Place URL var outside of function.
Merge pull request #2 from andrewminton/patch-1

Patch 1