URL Rewriting and Redirect in Linux Container in Azure App Service

PointSolutions 1 Reputation point
2021-06-14T15:42:22.157+00:00

Hello,

We have created a linux container and deployed it to Azure App service. This is an Angular + .NET Core application. Here, we are trying to fix an issue with Angular application where it redirects a URL without hash (#) to home page. We want to rather load such URLs directly from web server (a folder having html files under wwwroot). For this purpose, we see only viable solution using URL Rewriting and Redirect settings added in a web.config file. However, placing this web.config file in wwwroot or .htaccess file in wwwroot has no effect.

Is there any solution for this requirement without using Azure Front Door or Application Gateway as our app service does not have these enabled currently in the system?

Azure Container Instances
Azure Container Instances
An Azure service that provides customers with a serverless container experience.
692 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,684 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. SnehaAgrawal-MSFT 21,431 Reputation points
    2021-06-16T16:31:30.813+00:00

    Thanks! This seems like a generic angular routing.
    “For example if we have a html in the directory src/static-pages/page1.html, by default if you add that path to the assets section of your angular.json, it will exist at the route http://hostname/static-pages/page1.html. Angular allows you to change the resolve path for this asset to be whatever you want by providing a few extra pieces of information into the assets section when referencing your static html or other asset.”

    Source : https://stackoverflow.com/questions/53416871/routing-to-static-html-page-in-angular-6

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.