improve RewriteURL - urlencode and trim segments to mitigate punctuation double dashes