Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Colin 46 posts 146 karma points
    Apr 21, 2020 @ 13:12
    Colin
    0

    Help converting Umbraco redirect to IIS

    Hi everyone

    I have one Umbraco with multiple sites in multiple languages. One of the UrlRewriting rules i have is

                <add name="ProductUK" virtualUrl="^~/uk/products/(.*)/(.*)" destinationUrl="/uk/products/product?id=$1" rewriteUrlParameter="ExcludeFromClientQueryString" ignoreCase="true" />
    

    Similar pattern for other countries.

    I am reading up on IIS Rewrite (not sure if i need to convert it from Umbraco to IIS but thought to give it a go). I produced something like

            <rules>
    

                                                                                <match url="/uk/products/product?id=$1" />
    
                                                                                <action type="Redirect" url="/uk/products/(.*)/(.*)" appendQueryString="false" />
    
                                                                </rule>
    
            </rules>
    
        </rewrite>
    

    but this doesnt work. I do have IIS rewrite with canonical links so not sure if theres some issue somewhere but if someone can help me convert the above working rule from Umbraco to is equivalent IIS version that could help narrow down the problem?

    Appreciate any ideas.

    Many thanks

  • Yakov Lebski 549 posts 2113 karma points
    Apr 21, 2020 @ 18:12
    Yakov Lebski
    0

    The better way is to use IIS rewrite module https://www.iis.net/downloads/microsoft/url-rewrite

  • Colin 46 posts 146 karma points
    Apr 21, 2020 @ 20:16
    Colin
    0

    Hi

    That's what I'm using but can't figure out the correct way to convert from Umbraco URL writer to IIS?

    Ta

  • Amir Khan 1282 posts 2739 karma points
    Apr 21, 2020 @ 21:06
Please Sign in or register to post replies

Write your reply to:

Draft