Or you could just use `preg_replace` with `urldecode` in the URL construction to retain special characters in the URL such as what are currently in your sitemap. preg_replace("/%u([0-9a-f]{3,4})/i","&#x\\1;",urldecode($[attach_necessary_object_here])); This way the URL's would be:- mysite.com/here/there