locked
Redirect url with a hashcode to another with same hashcode in IIS10 RRS feed

  • Question

  • User1227043395 posted

    I need to redirect a url with a variable hashcode to another url with that same hashcode in IIS10 (Windows Server 2019).

    Example:

    https://www.example.com/hello/sd54effg1g5s11d5111dwds21fds2f1ffd

    Needs to redirect to:

    https://subdomain.example.com/hello/sd54effg1g5s11d5111dwds21fds2f1ffd

    Thank you in advance!

    Thursday, November 14, 2019 12:19 PM

All replies

  • User-848649084 posted

    Hi,

    You could try below rule:

     <rule name="redirect hashcode" stopProcessing="true">
                        <match url="(.*)" />
                        <conditions>
                            <add input="{HTTPS}" pattern="on" />
                            <add input="{HTTP_HOST}" pattern="^www.example.com$" />
                            <add input="{REQUEST_URI}" pattern="/hello/[a-zA-Z0-9]+$" />
                        </conditions>
                        <action type="Redirect" url="https://subdomain.example.com{C:0}" appendQueryString="false" />
                    </rule>

    Friday, November 15, 2019 5:54 AM