Use urlparse instead of split()ing