Friday 25 October 2013

URL Writting rule Example

              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=([^=&amp;]+)$" />
                    </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

रूस-यूक्रेन संकट लाइव: भारतीयों को 'उपलब्ध किसी भी साधन' के माध्यम से कीव को तत्काल छोड़ने के लिए कहा

  रूस यूक्रेन संकट लाइव: कीव में भारतीय दूतावास ने मंगलवार को जारी एक एडवाइजरी में भारतीयों को  'किसी भी उपलब्ध साधन' के माध्यम से क...