Rewrite url in XMLHttpRequest