We are excited to announce that the IIS.NET Forums are moving to the new Microsoft Q&A experience. Learn more >

Is It Possible to Redirect to a Different Port Using URL Rewrite?RSS

2 replies

Last post Jun 20, 2021 09:34 AM by akheerbaloch56

‹ Previous Thread|Next Thread ›
  • Is It Possible to Redirect to a Different Port Using URL Rewrite?

    May 11, 2021 09:07 PM|CodegoErgoSum|LINK

    Hi, Everybody!

    I would like to be able to redirect (or intercept) a specific URL (e.g., http://<server>/<servicePath>/<serviceName>.asmx) to a different port (http://<server>:<portNumber>/<servicePath>/<serviceName>.asmx) where <server>, <portNumber>, <servicePath> and <serviceName> are placeholders.  Is that possible with URL Rewrite?  I am having a most difficult time with it.

  • Re: Is It Possible to Redirect to a Different Port Using URL Rewrite?

    May 12, 2021 03:04 AM|samwu|LINK

    Hi CodegoErgoSum,

    CodegoErgoSum

    http://<server>/<servicePath>/<serviceName>.asmx) to a different port (http://<server>:<portNumber>/<servicePath>/<serviceName>.asmx) where <server>, <portNumber>, <servicePath> and <serviceName> are placeholders.  Is that possible with URL Rewrite?

    You only need to change the port number in redirect rule, here an example for you as a reference:

    <rules>
       <rule name="test" stopProcessing="true">
            <match url=".*" />
       <action type="Redirect" url="http://<server>:<portNumber>/{R:0}" />
    </rule>

    Best regards,

    Sam

    IIS.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today. Learn more >
  • Re: Is It Possible to Redirect to a Different Port Using URL Rewrite?

    Jun 20, 2021 09:34 AM|akheerbaloch56|LINK

    <rules>
       <rule name="test" stopProcessing="true">
            <match url=".*" />
       <action type="Redirect" url="http://<server>:<portNumber>/{R:0}" />
    </rule>

    Best regards,

    Sam

    Hello admin it still not working for Mine, or Should I have to post a new Question at Microsoft? 

‹ Previous Thread|Next Thread ›