Fixes bug with the buildURL function and posting to directories in IIS