Add a callback to the rewriteURI method