Hello,
I am a noob at URL rewrite, so hopefully someone would be kind enough to assist me. :)
Here are 3 levels of the URL.
http://www.something.com/SH_Catalog.aspx?pcid=Whatever
http://www.something.com/SH_Catalog.aspx?pcid=Whatever&brid=You
http://www.something.com/SH_Catalog.aspx?pcid=Whatever&brid=You&nm=Want&vl=Here
I am trying to make it look like this:
http://www.something.com/Whatever/You/Want/Here
<rule name="RedirectUserFriendlyURL1" stopProcessing="true"><match url="^SH_Catalog\.aspx$" /><conditions><add input="{REQUEST_METHOD}" pattern="^POST$" negate="true" /><add input="{QUERY_STRING}" pattern="^pcid=([^=&]+)&brid=([^=&]+)&nm=([^=&]+)&vl=([^=&]+)$" /></conditions><action type="Redirect" url="{C:1}/{C:2}/{C:3}/{C:4}" appendQueryString="false" /></rule><rule name="RewriteUserFriendlyURL1" stopProcessing="true"><match url="^([^/]+)/([^/]+)/([^/]+)/([^/]+)/?$" /><conditions><add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /><add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /></conditions><action type="Rewrite" url="SH_Catalog.aspx?pcid={R:1}&brid={R:2}&nm={R:3}&vl={R:4}" /></rule></rules><outboundRules><rule name="OutboundRewriteUserFriendlyURL1" preCondition="ResponseIsHtml1"><match filterByTags="A, Form, Img" pattern="^(.*/)SH_Catalog\.aspx\?pcid=([^=&]+)&(?:amp;)?brid=([^=&]+)&(?:amp;)?nm=([^=&]+)&(?:amp;)?vl=([^=&]+)$" /><action type="Rewrite" value="{R:1}{R:2}/{R:3}/{R:4}/{R:5}/" /></rule><preConditions><preCondition name="ResponseIsHtml1"><add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" /></preCondition></preConditions></outboundRules>
Here is the inbound and outbound rules. The outbound is not working for all i can tell, and the inbound only works partially on the third level of URL
Here are a couple of Real world examples of the URL i am trying to clean up:
/SH_Catalog.aspx?pcid=Towels_~_Wipes&brid=KIMBERLY-CLARK_PROFESSIONAL*&nm=Towel/Wipe_Type&vl=Wet_Wipes
/SH_Catalog.aspx?pcid=Batteries&brid=Energizer&nm=Battery_Size&vl=AAA
/SH_Catalog.aspx?pcid=CDs/DVDs&brid=Maxell&nm=Disk_Type&vl=DVD-R
/SH_Catalog.aspx?pcid=Appointment_Books&brid=House_of_Doolittle&nm=Size&vl=8_1/2_x_11
/SH_Catalog.aspx?pcid=Appointment_Books&brid=House_of_Doolittle&nm=Appointment_Ruling&vl=8_AM_to_5_PM_Mon.-Fri.
Can someone help me fix this to where it will work?