fix invalid url rewriting (see #10)