# Php Redirect With Slim Framework in Azure App Service

**URL:** <https://discourse.slimframework.com/t/php-redirect-with-slim-framework-in-azure-app-service/4383>\
**Category:** Questions\
**Created:** [September 3, 2020, 12:48am UTC](https://discourse.slimframework.com/t/php-redirect-with-slim-framework-in-azure-app-service/4383 "2020-09-03T00:48:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![basusingh](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/basusingh/32/1237_2.png) [@basusingh](https://discourse.slimframework.com/u/basusingh)\
**Post date:** [September 3, 2020, 12:48am UTC](https://discourse.slimframework.com/t/php-redirect-with-slim-framework-in-azure-app-service/4383/1 "2020-09-03T00:48:44Z")

</div>

I’m using Slim 4. In my code, I’m trying to redirect 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](http://localhost), it worked fine. But, after uploading on azure app service and running, I’m just getting a blank page. The URL stays the same.

My .htaccess:  
RewriteEngine On  
RewriteCond %{REQUEST\_FILENAME} !-f  
RewriteCond %{REQUEST\_FILENAME} !-d  
RewriteRule ^ index.php [QSA,L]

Response header:

Request Method: GET  
Status Code: 200 OK  
Remote Address: 52.237.246.162:443  
Referrer Policy: no-referrer-when-downgrade  
Content-Length: 1  
Content-Type: text/html; charset=UTF-8  
Date: Thu, 03 Sep 2020 00:14:24 GMT  
Server: Apache  
X-Powered-By: PHP/7.3.15  
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng, _/_ ;q=0.8,application/signed-exchange;v=b3;q=0.9  
Accept-Encoding: gzip, deflate, br  
Accept-Language: en-US,en;q=0.9  
Connection: keep-alive  
Host: [url-shortner-in.azurewebsites.net](http://url-shortner-in.azurewebsites.net/)  
Sec-Fetch-Dest: document  
Sec-Fetch-Mode: navigate  
Sec-Fetch-Site: none  
Sec-Fetch-User: ?1  
Upgrade-Insecure-Requests: 1  
User-Agent: Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Mobile Safari/537.36

---

<div class="post-metadata">

**Author:** ![tflight](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/tflight/32/1205_2.png) [@tflight](https://discourse.slimframework.com/u/tflight)\
**Post date:** [September 3, 2020, 11:01am UTC](https://discourse.slimframework.com/t/php-redirect-with-slim-framework-in-azure-app-service/4383/2 "2020-09-03T11:01:15Z")

</div>

What do the response headers look like?

---

<div class="post-metadata">

**Author:** ![basusingh](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/basusingh/32/1237_2.png) [@basusingh](https://discourse.slimframework.com/u/basusingh)\
**Post date:** [September 3, 2020, 11:08am UTC](https://discourse.slimframework.com/t/php-redirect-with-slim-framework-in-azure-app-service/4383/3 "2020-09-03T11:08:35Z")

</div>

Updated the question with the response header. Status code is 200 but I’m returning 302.
