Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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)?

like image 204
FBryant87 Avatar asked Oct 31 '22 01:10

FBryant87


1 Answers

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).

like image 195
crokusek Avatar answered Nov 09 '22 11:11

crokusek