A web application (created on VS 2010 with default settings) is run under “default web site” on an IIS server on a local machine. There is a Rewrite rule, whose target is in outside domain, i.e. requires internet access.
This rule doesn’t work. The regular expression is fine – works when I change action from Rewrite to Redirect. Seems like “the site” doesn’t have enough permissions for internet access.
How can it be fixed, and still be a “Rewrite” rule?
Rewrite module passes changed URL to the underlying layer (ASP.NET application for example) on your web server, to the same application it is configured. It does not perform any additional requests. I bet yor web application has no binding to the rewrited URL and fails to process the request.
So, in general, rewrite rule is not going to help you implement HTTP proxy. Change it to redirect or implement a handler to send request to the target server and pass it back to the client.
UPD: similar question Can Url Rewrite only rewrite to an internal url?