properly handle rewrite_urls when sending