L
L
lA_Ai2015-07-14 12:19:13
Nginx
lA_Ai, 2015-07-14 12:19:13

Nginx: how to give 200 code to 302 redirect?

There is a bunch of nginx + php-fpm. nginx config - slightly modified yii config ( yiiframework.ru/doc/guide/ru/quickstart.apache-ngi... ). At one of the addresses on the php side, a redirect of the form header( "Location: " . $url ); is made, it is necessary that the redirect give the client a 200 code instead of 302. How can this be done?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Momot, 2015-07-14
@AlexMt

<?php
http_response_code(200);
?>

Naturally, before sending headers.

S
ShamblerR, 2015-07-14
@ShamblerR

Can to you the normal alias will go?

location /i/ {
    alias /data/w3/images/;
}
на запрос “/i/top.gif” будет отдан файл /data/w3/images/top.gif.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question