Welcome to the Microsoft Q&A Platform. Thank you for reaching out & I hope you are doing well.
I understand that you would like to use Path-Based Routing to route traffic across two app service domains.
Your requirement is that,
- Request for mydomain.com/bar -> Redirected to bar.azurewebsites.net
- Request for mydomain.com/bar/login -> Redirected to bar.azurewebsites.net/login
- Request for mydomain.com/bar/site.css -> Redirected to bar.azurewebsites.net/site.css
The combination of Path-based route and override backend path value as "/" should redirect mydomain.com/bar to bar.azurewebsites.net*
The issue is that "subsequent" requests, while using a Path based Rule does not work and are going to "foo.azurewebsites.net"
I tried to repo this in my lab using JAVA WebApps, however, I am not able to repo the issue.
Later, you confirmed this is because of "~" sign in links, which in ASP.NET refers to the web root and also informed you were able to resolve this.
Since the virtual path is "/", this is assumed to be the root, even if we publish in a sub directory like "/bar". The app will only recognize "/bar" as the root if you create an extra virtual path under that name. This, however, means that you will need two virtual paths in the same app and one of them, the "/" path, will point nowhere (since it can't be removed or changed).
Kindly let us know if the below helps or you need further assistance on this issue.
Thanks,
Kapil
Please don’t forget to close the thread by clicking "Accept the answer" wherever the information provided helps you, as this can be beneficial to other community members.