How can convert url www.mydomain.com/home to www.mydomain.com/api/v1/home
if the requested api link don't contain api/v1
I need someone help to write iis rewrite rule in web.config to fit this case
best regards
How can convert url www.mydomain.com/home to www.mydomain.com/api/v1/home
if the requested api link don't contain api/v1
I need someone help to write iis rewrite rule in web.config to fit this case
best regards
if the requested api link don't contain api/v1
You can use the parameter ^home$ to make the requested url match only home, this way api/v1 is not contained.
<rewrite>
<rules>
<rule name="Test" stopProcessing="true">
<match url="^home$" />
<conditions>
<add input="{HTTP_HOST}" pattern="^www.domainname.com$" />
</conditions>
<action type="Redirect" url="http://www.domainname.com/api/v1/home" appendQueryString="false" />
</rule>
</rules>
</rewrite>
Body cannot contain mydomain, so i use domainname instead of it.