Reputation: 4640
I want to rewrite this URL:
into this:
https://localhost/My/Test.dll
(It is a GET mvc action)https://localhost:444/Api/Test
I use this rule:
<rule name="Rewrite rule1 for Thing 2" patternSyntax="Wildcard" stopProcessing="true">
<match url="*" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{QUERY_STRING}" pattern="*/My/Test.dll" />
</conditions>
<action type="Rewrite" url="https://localhost:444/Api/Test" appendQueryString="false" />
</rule>
Any idea why I get a 404 errror when hitting https://localhost/My/Test.dll
with my browser?
I have URL Rewrite installed.
Do I also need to install Application Request Routing?
Upvotes: 0
Views: 466
Reputation: 54887
The string you are attempting to match is not the query string, but the path in the URL. Try the following instead:
<rule name="Rewrite rule1 for Thing 2" patternSyntax="Wildcard" stopProcessing="true">
<match url="My/Test\.dll" />
<action type="Rewrite" url="Api/Test" appendQueryString="false" />
</rule>
Upvotes: 1