I'm trying to catch outgoing HTTP request and replace it with another. For example i have a application that initiate request to www.xxxxxxxxxx.com/something
I need to catch this request and instead of going to www.xxxxxxxxxx.com/something i have to redirect it to www.yyyyyyyyyyyy.com/somethingElse.
The request is made by application that i have no access to the source code so it have to be done outside the application.
Anyone may give me a hint how this may be done?
you can use fiddler auto responder for this
Obviously this would only work if you have full access to the client machine. If this needs to be done from the server you can set up a proxy on the server to relay the request to a different web page.
check this blog entry for the details
This blog post describes how to modify requests, but you can just as easily forward them to a different domain.
It is also possible to use this technique over HTTPS using generated certificates http://www.fiddler2.com/fiddler/help/httpsdecryption.asp
Some people appear to be claiming that this answer will not work, i appreciate the fact that they are baffled by the capabilities of fiddler, but in the end they are wrong, do your research.
An even easier solution could be to override your local DNS, you can do this with the HOSTS file on windows, keep in mind that this will send the original host headers to the different domain, which you may not want.
Use a smart proxy or rewrite the URL at the server end.
If the request is initiated from the client side then you can't intercept that request and redirect user to some other address. However, you may add a HTTPModule in the HTTP Pipeline that will change the URL to some other address before sending response to the client browser.
No, you cannot do that on client side.
should redirect
to www.yyyyyyyyyyyy.com/somethingElse
when any request comes to www.xxxxxxxxxx.com/something
on the server side
.What kind of application is this! Normally if you have a webserver like apache, lighttpd, cherokee in front of it or the application is deployed on it, than you can use URL-Rewritting.
Apache can do it, even to a different Server. http://httpd.apache.org/docs/2.0/misc/rewriteguide.html