URL Rewrite SubDirectoryRSS

1 reply

Last post Jun 09, 2020 07:26 AM by Yuk Ding

  • URL Rewrite SubDirectory

    Jun 09, 2020 03:15 AM|chrissezhi|LINK

    Hello all - 

    Total noob here so step by step would be beneficial. I am wanting to do the following:

    We have an old domain lets say http://portal.acme.com/pages/login.aspx (this may have been saved in favorites etc. ) what we want to do is when the request comes in - how do we just change to portal.acme.com (stripping the subdirectory away)?

    Thanks!

    Chris

  • Re: URL Rewrite SubDirectory

    Jun 09, 2020 07:26 AM|Yuk Ding|LINK

    Hi Chrissezhi,

    Do you just want to redirect http://portal.acme.com/pages/login.aspx to http://portal.acme.com/ ?

    1.Please install URL rewrite module from here:

    https://www.iis.net/downloads/microsoft/url-rewrite

    2.Put this redirect rule to web.config  <system.webserver> section.

           <rewrite>
                <rules>
                    <rule name="Redirect rule" stopProcessing="true">
                        <match url="pages/login.aspx" />
                        <action type="Redirect" url="/" />
                    </rule>
                </rules>
            </rewrite>

    If the reply is helpful, it is appreciated if you could mark it as answer.

    Best Regards,

    Jokies Ding

    Yuk Ding

    MSDN Community Support
    Please remember to "Mark as Answer" the responses that resolved your issue.