URL Writting rule Example:===
example:---1. redirect store/plpcategory.aspx?cat=xyz to /xyz
then
2. rewrite /xyz to store/plpcategory.aspx?cat=xyz
1st step.
<rule name="plpcategoryUserFriendlyURL1" stopProcessing="true">
<match url="^store/plpcategory\.aspx$" />
<conditions>
<add input="{REQUEST_METHOD}" pattern="^POST$" negate="true" />
<add input="{QUERY_STRING}" pattern="^cat=([^=&]+)$" />
</conditions>
<action type="Redirect" url="{C:1}" appendQueryString="false" />
</rule>
=================================================================
2nd step.
<rule name="itemsRewriteUserFriendlyURL1" stopProcessing="true">
<match url="^([^/]+)/?$" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="false" />
<add input="{REQUEST_URI}" pattern="^/(online|events|global|fabrics|fashion|community|embroidery|promotions|testimonials|store|shop|secure|account|pay|controls|help|pages|xml|accessories|dberror|images|include|instore|masters)" negate="true" />
</conditions>
<action type="Rewrite" url="store/plpcategory.aspx?cat={R:1}" />
</rule>
No comments:
Post a Comment