FBryant87
FBryant87

Reputation: 4615

IIS URL Rewrite - how to see rewritten URL?

In IIS I've set up a basic URL Rewrite with an Inbound rule to perform a Rewrite action to another domain:

Pattern match: ^somedirectory/(.*)

Action type: Rewrite

Rewrite URL: http://www.google.com/{R:1} (using google just as a test)

The problem is, how can I actually see what the server has rewritten the URL to? When I check the IIS logs (I have "Log rewritten URL" option ticked), I would expect to see www.google.com somewhere - but it's nowhere to be found.

The pattern is definitely matching because I get the error: "502 - Web server received an invalid response while acting as a gateway or proxy server."

How can I see what is going on behind the scenes (how IIS has changed the request)?

Upvotes: 6

Views: 11680

Answers (1)

crokusek
crokusek

Reputation: 5624

One way is to enable "Failed Request Tracing" is IIS.

For the status code choose a range like 100-999 to capture all requests (even non-failing).

IIS will create an XML file for each request to a log directory. The XML can be viewed nicely within Internet Explorer (try the compact view tab).

Upvotes: 4

Related Questions