I need help getting a subdomain to work in my domain. Here's what I've done:
Using an FTP program, I created two subfolders in my root folder: WebApp1 and WebApp2
From the my web host's Control Panel, I created two Subdomain Pointers: WebApp1.MyDomain.Com pointing to subfolder WebApp1 and WebApp2.MyDomain.Com pointing to subfolder WebApp2
Using VS2019Pro I created an ASP.NET Core 3.0 Web Application (not MVC), called WebApp1, and successfully used Web Deploy to upload it to the WebApp1 subfolder.
Using a text editor and FTP program I created a simple index.html page and put it in the WebApp2 subfolder.
In the root of mydomain.com I made a Web.Config file that looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="webapp1.mydomain.com">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^webapp1.mydomain.com$" />
<add input="{PATH_INFO}" pattern="^/webapp1/" negate="true" />
</conditions>
<action type="Rewrite" url="\webapp1\{R:0}" />
</rule>
<rule name="webapp2.mydomain.com">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^webapp2.mydomain.com$" />
<add input="{PATH_INFO}" pattern="^/webapp2/" negate="true" />
</conditions>
<action type="Rewrite" url="\webapp1\{R:0}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
The result:
Going to h t t p://WebApp1.mydomain.com, (ASP.Net project) I get a totally blank screen. No webpage. No error. However, when I go to h t t p://www.mydomain.com/webapp1 it works totally fine. I see the ASP.Net Core App that I wrote and it works exactly as I want it to.
Meanwhile, going to h t t p://WebApp2.mydomain.com, (text editor project) it works flawlessly. So, I know the web.config file is working for a very simple target website, but it's NOT workign when I redirect to the far more complex ASP.Net web application at WebApp1.
What am I doing wrong? How do I tell my ASP.Net Core 3.0 project in the WebApp1 folder to properly route the incoming requests?
Thank you for any help and/or suggestions!
Jason