URL Rewrite from one subdomain to anotherRSS

1 reply

Last post May 27, 2020 01:53 AM by Jalpa Panchal

  • URL Rewrite from one subdomain to another

    May 26, 2020 01:50 PM|AngieN|LINK

    hello ,

    I have subdomain : aio.foo.com/news/.... , i want to redirect to oia.foo.com/news/....

    so when the users type : aio.foo.com/news/etc.... or they paste a link , the link should be re-written to : oia.foo.com/news...

    your help is veryyyyyyy apreciated :(

  • Re: URL Rewrite from one subdomain to another

    May 27, 2020 01:53 AM|Jalpa Panchal|LINK

    Hi,

    You could use below URL rewrite rule:

    <rule name="rule1" stopProcessing="true">
                        <match url="(.*)" />
                        <conditions>
                            <add input="{HTTP_HOST}" pattern="^aio.foo.com$" />
                            <add input="{REQUEST_URI}" pattern="^/news/(.*)" />
                        </conditions>
                        <action type="Redirect" url="http://oia.foo.com/news/{C:1}" />
                    </rule>

    if you want to use rewrite then use this below rule:

    <rule name="rule1" stopProcessing="true">
                        <match url="(.*)" />
                        <conditions>
                            <add input="{HTTP_HOST}" pattern="^aio.foo.com$" />
                            <add input="{REQUEST_URI}" pattern="^/news/(.*)" />
                        </conditions>
                        <action type="Rewrite" url="http://oia.foo.com/news/{C:1}" logRewrittenUrl="true" />
                    </rule>

    Regards,

    Jalpa

    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 MSDNFSF@microsoft.com.