-1

I have a angular application hosted on IIS server Under Default web site with folder name app let say for example my domain name is domain1.com and have static ip for e.g 1.2.3.4

Under my dns configuration i have mapped my domain1.com with ip address 1.2.3.4 this works fine and when i browse my domain1.com it show a default IIS page which is absolutely fine!

My angular application is under Default web site.

If i need to browse my angular application then i need to browse to domain1.com/App OR 1.2.3.4/App

this is also working as expected!

Angular Application

My question is how do i redirect a request my request of domain1.com To domina1.com/App

Eg. if a user browse to domain1.com then it should be redirected to domain1.com/App

what i have tried till now!

1) I installed Http redirection on IIS server and added a reroute rule ex redirect domain1.com/ to domain.com/app.

but above seems to be not working because it gives a error message too many time redirect when i searched for error it says if you have used URL REWRITE MODULE extension it will not work

https://help.duo.com/s/article/4554?language=en_US

2) I tried to add URL redirect to under my DNS console but that does not seems to work.

Arvind Maurya
  • 910
  • 12
  • 25
  • Have a look at the solutions provided in the following link https://serverfault.com/questions/411184/how-to-change-default-application-in-a-website-in-iis-7-5-on-windows-7 – Abhishek Apr 11 '20 at 09:31

1 Answers1

0

First, try to install the URL rewrite module from web platform installer or manually from using below link:

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

and use the rule:

<rule name="test1" enabled="true" stopProcessing="true">
                    <match url="^$" />
                    <action type="Redirect" url="http://domain1.com/react1/" />
                </rule>

enter image description here

Note:

use your app name instead of react1.

https://learn.microsoft.com/en-us/iis/extensions/url-rewrite-module/creating-rewrite-rules-for-the-url-rewrite-module

Jalpa Panchal
  • 8,251
  • 1
  • 11
  • 26