0

We recently deployed an Azure App Service as code, in a Linux environment with a PHP stack.

So far everything worked fine but as often required the web developers wanted to enable URL rewrite for the site.

As I see, I cannot make modifications to the apache2.conf via SSH, as any changes get reverted; so I cant set AllowOverride Apache parameters for the .htaccess files. Is there any workaround to enable URL rewrite somehow, or to modify the apache2.conf, without redeploying the site to a custom container?

Thank you for reading, any help would be appreciated.

mforsetti
  • 2,488
  • 2
  • 14
  • 20
  • you can add `.htaccess` on your repository root, Azure App Service will respect that. it's even in the [docs](https://docs.microsoft.com/en-us/azure/app-service/containers/configure-language-php#change-site-root). – mforsetti Aug 07 '20 at 17:19
  • Thanks, i have been reading through that, but the site dev complained about some issue, and then the "allowoverride none" in apache2.conf confused me. So if we add an url rewrite rule and the +allowsymlinks option via .htaccess in folders, it should work the same? – Milan Novak Aug 09 '20 at 10:53
  • yes, it should. URL rewrite in Apache only requires `mod_rewrite`; use `FollowSymLinks` if you need it, though by default it's already set. – mforsetti Aug 09 '20 at 12:23

0 Answers0