Creating redirects with parameter and different countriesRSS

1 reply

Last post Apr 22, 2020 02:06 AM by Jalpa Panchal

  • Creating redirects with parameter and different countries

    Apr 21, 2020 02:31 PM|JamieP1|LINK

    I have a website with the following URL structure

    I would like to have it so the URLs are friendly. Something like

    Within my code i can generate the friendly URLs but i cant get the rewrite rule. This is what i have

    <rule name="single product" patternSyntax="ExactMatch" stopProcessing="true">
    <match url="/usa/allproducts/product?id=$1" />
    <action type="Redirect" url="/usa/allproducts/.*/.*" appendQueryString="false" />

    This doesnt work so wondering how i could go about creating this? In addition i have a canonical rule and https redirect in place, for which i can provide the code for if required (not including this now as i didnt want to make the original code look messy)


  • Re: Creating redirects with parameter and different countries

    Apr 22, 2020 02:06 AM|Jalpa Panchal|LINK


    You could try to use the below rule:

    <rule name="rule1" stopProcessing="true">
                        <match url="(.*)/allproducts/product$" />
                            <add input="{QUERY_STRING}" pattern="pid=(.*)" />
                        <action type="Redirect" url="{R:1}/allproducts/{C:1}" appendQueryString="false" />



    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue.
    If you have any compliments or complaints to MSDN Support, feel free to contact