I have the existing rule as xml that will rewrite or redirect any request to a specific url to its domain. It won’t let any outbound request go out of the domain.
I want to add an EXCEPTION to only one url (say abc.com). How to add an exception to a particular request?
(please donot provide anything like global.asax because IIS is not working with ASP.NET application but with some other application).
current rule:
<rewrite>
<rules>
<rule name="topcontent">
<match-url=".*">
<action type="rewrite" url="mysite.com/{R:0}"/>
</match-url>
</rule>
</rules>
</rewrite>
If any inbound request comes it rewrites the url to mysite.com. I need to add an exception to say abc.com/…… How to do this?
you can use below code:
a condition has been added to the rule, so if it does not come true, then the action will be executed (
negate="true")it will check the
http://{HTTP_HOST}/urland if it does not match abc.com or http://www.abc.com which is exception here, then it will go for the action.also I think that you may use
Redirecthere instead ofRewrite