Reputation: 1837
<rule name="Directories The" stopProcessing="true">
<match url="^Directories/The" />
<action type="Redirect" url="/" />
</rule>`
I have two url like this www.mydomain/Directories/the and www.mydomain/Directories/the-hindu. But i only want to redirect first url only. If i put above code two urls are redirecting.
I tried with exact match and wild card also not working. I dont want www.mydomain/Directories/the-hindu to my home page
`
Upvotes: 0
Views: 352
Reputation: 8736
The problem is that your regexp ^Directories/The
is matching for both URLs:
You need to add the end of string condition to your regexp. The correct rule should be:
<rule name="Directories The" stopProcessing="true">
<match url="^Directories/The$" />
<action type="Redirect" url="/" />
</rule>`
And this rule will match only www.mydomain/Directories/the
Upvotes: 1