Reputation: 1198
Using URL rewrite in the IIS on windows 10.
I want to check specific url in the IIS.
Below is the condition I need to check.
I have checked {URL} so far as following.
<rule name="RuleForSite1" stopProcessing="true">
<match url="(.*)" ignoreCase="false" />
<conditions>
<add input="{URL}" pattern="^(http\:\/\/)?(www\.)?mtl173(\/)?$" />
</conditions>
<action type="Redirect" url="www.mtl173/app1/" />
</rule>
Note: when I test all the URLs in the IIS, all test passed but when I run the same URL from the browser, it shows me the default IIS page and does not redirect me to the app1/.
However, the above does not work and does not redirect the URL to the given path. Any remediations for the issue I am facing?
Expected result:
When I enter any of the following URL, it should redirect me to the /app1.
Upvotes: 0
Views: 91
Reputation: 12749
You can use below url rewrite rule.
<rule name="RuleForSite1" stopProcessing="true">
<match url="(.*)" ignoreCase="false" />
<conditions>
<add input="{HTTP_HOST}" pattern="^www.mtl173|mtl173$" />
<add input="{REQUEST_URI}" pattern="app1" negate="true" />
</conditions>
<action type="Redirect" url="http://www.mtl173/app1/" />
</rule>
You can learn about server variable from below links: IIS Server Variables
Upvotes: 1