can't use toURL() as url isn't absolute. refactored splitquery to just receive the query string.