1

I have a working 301 redirect setup for languages that looks like this:

<rule name="mygreatrule" stopProcessing="true">
    <match url="^productname" />
    <conditions logicalGrouping="MatchAll">
        <add input="{HTTP_HOST}" pattern="^(www\.)?example1.com$" />
        <add input="{QUERY_STRING}" pattern="lang=(de|fr|is|es)" />
    </conditions>
    <action type="Redirect" url="https://www.example2.com/abcd/{C:1}/product/myproduct/productname" appendQueryString="false" redirectType="Permanent" />
</rule>

But this works for example for URLs like

https://www.example1.com/productname/?lang=de

How would I have to change this redirect, if the string "?lang=de" would be optional? So for example

https://www.example1.com/productname

and I'd like to redirect this one to the en version of the site.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.