import code from https://github.com/sentric/url-normalization