Redirecting user in Azure App Service Plan with Slim Framework
I'm using Slim 4 in my Azure App Service. In my code, I'm trying to redirect user to a URL:
return $response
->withHeader('Location', 'http://www.google.com')
->withStatus(302);
When I run it on my local computer on WAMP server using http://localhost, it worked fine. But, after uploading the code on azure app service and running it, I'm just getting a blank page. The url also stays the same (myurl.azurewebsites.net)
My .htaccess:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [QSA,L]
Is there something wrong with the Azure app service plan since it works on my local host on WAMP but not on Azure? It's Php 7.4 running on Linux server.