views:

9

answers:

0

The URL rewrite module doubles the query string in IIS 7.5 on a post back (when appendQueryString="true" which sometimes must be...). Below is an example a rule that works as expected in IIS 7.0 and is in use in our production environment. This is a big issue for us since we are attempting to migrate to a new environment running IIS 7.5.


NOTE appendQueryString="false" does NOT solve the problem in all cases... If you need to the ability to append to the query string and post back on the same page then at this point the IIS rewrite module is unusable in IIS 7.5. I have spent the last few days looking for a solution, and I not yet come across any form of a solution that works for all of my rewritten pages.


<rule name="RedirectUserFriendlyURL25" stopProcessing="true"> <match url="^Community/GroupDiscussions\.aspx$" /> <conditions> <add input="{REQUEST_METHOD}" pattern="^POST$" negate="true" /> <add input="{QUERY_STRING}" pattern="^GroupID=([^=&amp;]+)&amp;Name=([^=&amp;]+)$" /> </conditions> <action type="Redirect" url="Community/GroupDiscussions/{C:1}/{C:2}" appendQueryString="false" /> </rule> <rule name="RewriteUserFriendlyURL25" stopProcessing="true"> <match url="^Community/GroupDiscussions/([^/]+)/([^/]+)/?$" /> <conditions> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> </conditions> <action type="Rewrite" url="Community/GroupDiscussions.aspx?GroupID={R:1}&amp;Name={R:2}" /> </rule>