Score:0

IIS Redirects to multiple subfolders then errors when I use different rule name

ru flag

I have a very strange issue which I couldn't figure out. In the IIS under URL rewrite module I have a redirect rule, which works absolutely fine when it is under a specific rule name, however, when I change rule name it redirects to so many subfolders. For example, when I set my rule name "Redirect to signup page" and access the URL

example.com/companyName/login

it redirects me to

example.com/subFolder/companyName/login

which is what I wanted. However, as the rule name doesn't reflect what the redirect rule is doing here, I want to keep the rule name as "Redirect to login page". When I change the rule name it doesn't work and accessing the same url redirects me to

example.com/subfolder/subfolder/subfolder/subfolder/...(many repetition)..../subfolder/companyName/login

this issue is almost similar to this question, but, the solution in there doesn't work for me.

the rule in my web.config file is following:

<rule name="Rediect to login page" enabled="true" patternSyntax="Wildcard" stopProcessing="true">
                <match url="*" />
                <conditions logicalGrouping="MatchAny" trackAllCaptures="false">
                    <add input="{CACHE_URL}" pattern="*://*/*/login*" />
                </conditions>
                <action type="Redirect" url="https://example.com/subFolder/{C:3}/login" redirectType="Permanent" />
            </rule>
bjoster avatar
cn flag
Can you post your rule from web.config please?
Fazla Elahi Md Jubayer avatar
ru flag
@bjoster I have added the rule from web.config. Please let me know if you need any more information.
bjoster avatar
cn flag
The rule name is just the display name and has no influence on what the rule technically does. As expected, I can't reproduce the problem here. When you do the change, does it change anything else in the web.config (like `patternSyntax` for example)? that would explain a lot ...
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.