2015-07-20, 18:49:05
(2015-07-20, 18:15:31)alexeyGL Wrote: Hi!
Thank you for your plugin!
But I have a problem with using it.
Redirection works, but unfortunatelly it returns new Location as https instead of http.
I found following condition in your plugin:
so I went to check my request with firebug and it is good:PHP Code:if ($_SERVER['SERVER_PROTOCOL'] == 'HTTP/1.1') {
$protocol = 'http://';
} else {
$protocol = 'https://';
}
GET /cms/test-redirect HTTP/1.1
...
but the plugin responds me
...
Location: https://my-host.com/cms/new_location/
Does anyone had such problem?
Tell me please, what is the problem could be.
UPD
I check my request in webserver log and it is strange, but it is different for the same request:
GET /cms/test-redirect HTTP/1.0
Tell me please, how this is possible?
And what is the reason all requests exept HTTP/1.1 redirect to https in the plugin?
GetSimple version 3.3.3
PHP 5.2.17
Apache/1.3.42 (FreeBSD)
I found the reason of such behaviour. This is because of nginx.
Some versions of nginx connect with apache via http/1.1
This is not a new problem as well as I see
CLIENT <---- (HTTP 1.1) ----> NGINX <----- (HTTP 1.0) ----> SERVER
So, my question about plugin is still actual
What is the reason all requests exept HTTP/1.1 redirect to https in the plugin? Should http/1.0 be added to condition?