Fix issue #51 wherein paths were being rewritten incorrectly.

When registry urls contained path segments, the rewriter didn't correctly strip the segments prior to appending the true file path. This corrects that behavior.