locked
Api Domain Redirection RRS feed

  • Question

  • User1995462294 posted

    Hi guys, 

    Our company is moving their production server to different hosting provider. We have bunch of rest api's deployed on our existing production server. We want to host these web services on the new domain. Since we are moving to our new servers, all web services  hosted in our current domain will be pointed to our new domain. The problem is - our clients are currently using web services from the current domain. We don't want our clients to change their application code to point to new domain server. Is there any easy way to do domain redirection from the current to new so when any client makes an api request, then the request will be redirected to our new domain.

    Thanks

    Tuesday, February 28, 2017 11:00 PM

All replies

  • User-2057865890 posted

    Hi Bhupinder7,

    You could use url rewriting.

    <rule name="Canonical Host Name" stopProcessing="true">
      <match url="(.*)" />
      <conditions>
        <add input="{HTTP_HOST}" negate="true" pattern="^oldsite\.com$" />
      </conditions>
      <action type="Redirect" url="http://newsite.com/{R:1}" redirectType="Permanent" />
    </rule>

    reference: https://forums.asp.net/t/1944549.aspx

    Best Regards,

    Chris

    Wednesday, March 1, 2017 6:33 AM
  • User1995462294 posted

    Hi Chris , is this configuration settings to put in web.config file of web service which is placed in our current server ? If that is the case, we are moving apps and web services from current server domain to new ? 

    Wednesday, March 1, 2017 3:27 PM
  • User-2057865890 posted

    Hi bhupinder7,

    Sorry, too late reply.

    bhupinder7

    is this configuration settings to put in web.config file of web service which is placed in our current server ? If that is the case, we are moving apps and web services from current server domain to new ?

    As far as I know, that's it. So you can navigate to the new server domain.

    If you want to know the detailed URL Rewrite Module, I suggest you can visit the IIS URL Rewrite Module forum for getting suitable help.

    Best Regards,

    Chris

    Saturday, April 1, 2017 8:18 AM