Subdomain rewrite

Discussion in 'General troubleshooting' started by Harold, Dec 28, 2024.

  1. I have created a new VS 2022 solution for a Blazor application. Using the default code I published it to a subfolder that I created and used the App Roots option to turn it into an application.

    When I browse to it the app loads with several resources not being found.
    http://[domain]/baTest1

    I read all the discussion in the forum about using rewrite in the web.config file. I create one and placed it in the domain folder (//ftppub.everleap.com//site/wwwroot).

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
    <location path="." inheritInChildApplications="false">
    <system.webServer>
    <rewrite>
    <rules>
    <rule name="baTest1 to sub folder" enabled="true" stopProcessing="true">
    <match url="(.*)" ignoreCase="true"/>
    <conditions logicalGrouping="MatchAll">
    <add input="{HTTP_HOST}" pattern="^(www.)?[domain].com" ignoreCase="true"/>
    <add input="{PATH_INFO}" pattern="^/baTest1/" negate="true"/>
    </conditions>
    <action type="Rewrite" url="\baTest1\{R:0}"/>
    </rule>
    </rules>
    </rewrite>
    </system.webServer>
    </location>
    </configuration>

    When using Chrome developer tools and viewing the calls, I'm seeing the request for favicon.png and getting 404. Chrome is showing:
    http://[domain].com/favicon.png
    which, if the rewrite was being used would convert to:
    http://[domain].com/baTest1/favicon.png
    This resource does exist. Yet I'm still getting 404.

    Any thoughts on why this is not working?
    Any suggestions on how to go about debugging why this is not working?
     

Share This Page