Insert %2F after lead slash, rather than replace it
Otherwise non-root URLs will not resolve properly!