Redirecting user in Azure App Service Plan with Slim Framework

Ashish Kumar 1 Reputation point
2020-09-01T11:31:35+00:00

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.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,960 questions
{count} votes

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.