How to redirect requests to an old url(which uses the default ports) to a new url (which uses custom ports)?

techthiru 40 Reputation points
2024-06-05T16:40:23.4666667+00:00

We have a legacy .aspx web forms "web application" running IIS 10 and .Net Framework 4.8.

We want to separate it out of the "Default Web Site" and want it to run under it's own website say "MyApplicationSite"

Now are the challenges below.

We want the users to keep using their old URL's (probably they might have bookmarked the old URL)

The "default web site" has the port number :80 and :443 bound already.

When we create a New website, I believe it can not use the ports :80 and :443 and I must create bindings for :http & :https using some custom port numbers (which shouldn't be :80 or :443 I believe?)

But the users, if they must successfully browse the New site, they must be using the new port numbers in the URL correct? (given that the host/domain name is going to be the same).

Is there a way we can redirect requests made to the old URL which is bound to the default port numbers to be redirected to the new url with custom port numbers, without the users needing to update their bookmarks?

If it is possible, what are the options to achieve this?

Internet Information Services
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,396 questions
{count} votes

1 answer

Sort by: Most helpful
  1. AgaveJoe 27,421 Reputation points
    2024-06-05T17:48:06.4766667+00:00

    When we create a New website, I believe it can not use the ports :80 and :443 and I must create bindings for :http & :https using some custom port numbers (which shouldn't be :80 or :443 I believe?)

    You assumption is not completely true. The host name binding is used to distinguish sites in a shared hosting scenario. This assumes you've you purchased separate domain names for each site or are using subdomains and registered the domain name. Your domain name provider can help with DNS.

    Is there a way we can redirect requests made to the old URL which is bound to the default port numbers to be redirected to the new url with custom port numbers, without the users needing to update their bookmarks?

    The old site can simply do a Response.Redirect(MyNewSite:4443) in the Global.asax. Or you can write a redirect rule in IIS.

    https://video2.skills-academy.com/en-us/iis/configuration/system.webserver/httpredirect/

    0 comments No comments