I'm a Product Manager at Microsoft working on Azure Container Apps and Azure Static Web Apps. I also worked on Azure Functions and was a Cloud Developer Advocate.
Location
Vancouver, Canada
Work
Program Manager - Azure Container Apps and Static Web Apps at Microsoft
I'm a Product Manager at Microsoft working on Azure Container Apps and Azure Static Web Apps. I also worked on Azure Functions and was a Cloud Developer Advocate.
Location
Vancouver, Canada
Work
Program Manager - Azure Container Apps and Static Web Apps at Microsoft
PHP is the right stack to use for this on Linux. However, it uses Apache instead of IIS, so a web.config file won't work.
Instead, create a .htaccess file in /home/site/wwwroot like this:
RewriteEngine On
RewriteRule "^[^\.]+$" "index.html"
It rewrites any path that doesn't contain a . to the index page, which should work for most single page apps deployed this way. If your app is different, you may have to tweak this somewhat.
Hey Fabio. Are you using Linux or Windows App Service?
Hello Anthony, I'm using linux app service with PHP 7.3
Hi Fabio,
PHP is the right stack to use for this on Linux. However, it uses Apache instead of IIS, so a
web.config
file won't work.Instead, create a
.htaccess file
in/home/site/wwwroot
like this:It rewrites any path that doesn't contain a
.
to the index page, which should work for most single page apps deployed this way. If your app is different, you may have to tweak this somewhat.Many thanks Anthony,
I've changed to Windows instead of Linux and it works. Have a nice day.
Fabio