Link to home
Start Free TrialLog in
Avatar of Wayne Barron
Wayne BarronFlag for United States of America

asked on

IIS - Multiple URL Rewrite Rules with different names. etc... domain.com/One/itemhere and domain.com/Two/itemhere

Hello, all.

When creating my own URL Rewrite script with the error pages, I was able to do multiple redirects.
However, with IIS URL Rewrite, I am having an issue with it.

So, this is what I believe I need to do.


QueryStrings
domain.com/Main.asp?Type=One&OneID=1
domain.com/Main.asp?Type=Two&TwoID=1
domain.com/Main.asp?Type=Three&ThreeID=1

What it needs to be.
domain.com/One/ItemHere
domain.com/Two/ItemHere
domain.com/Three/ItemHere

This works, as it is grabbing everything, so everything you put in with: domain.com/something
Will get sent to this RULE.
                <rule name="BandMember" stopProcessing="true">
                    <match url="([_0-9a-z-(-)-,-]+)" />
                    <conditions>
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="Main.asp?Type=One&amp;BMID={R:1}" logRewrittenUrl="true" />
                </rule>

Open in new window

This does not??
I am thinking the "match url=" needs to have something similar in it, but, not this.
                <rule name="Label" stopProcessing="true">
                    <match url="Two/([_0-9a-z-(-)-,-]+)" />
                    <conditions>
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="Main.asp?Type=Two&amp;LabelID={R:1}" logRewrittenUrl="true" />
                </rule>

Open in new window


Any ideas on doing Multiple Rules, as I demonstrated above?

Wayne
ASKER CERTIFIED SOLUTION
Avatar of Wayne Barron
Wayne Barron
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial