{"action":"created","issue":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/9116","labels_url":"https://api.github.com/repos/yiisoft/yii2/issues/9116/labels{/name}","comments_url":"https://api.github.com/repos/yiisoft/yii2/issues/9116/comments","events_url":"https://api.github.com/repos/yiisoft/yii2/issues/9116/events","html_url":"https://github.com/yiisoft/yii2/issues/9116","id":95216201,"number":9116,"title":"Response::redirect don't keep https on url","user":{"login":"invaderhd","id":1872297,"avatar_url":"https://avatars.githubusercontent.com/u/1872297?v=3","gravatar_id":"","url":"https://api.github.com/users/invaderhd","html_url":"https://github.com/invaderhd","followers_url":"https://api.github.com/users/invaderhd/followers","following_url":"https://api.github.com/users/invaderhd/following{/other_user}","gists_url":"https://api.github.com/users/invaderhd/gists{/gist_id}","starred_url":"https://api.github.com/users/invaderhd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/invaderhd/subscriptions","organizations_url":"https://api.github.com/users/invaderhd/orgs","repos_url":"https://api.github.com/users/invaderhd/repos","events_url":"https://api.github.com/users/invaderhd/events{/privacy}","received_events_url":"https://api.github.com/users/invaderhd/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-15T14:56:19Z","updated_at":"2015-07-15T19:15:04Z","closed_at":null,"body":"In my website I need every request to be made using ssl. But if the user is logged out and try to access private content he will be redirected to domain.com/login but in this redirect the https is converted to http.\r\n\r\nI do some debug and I found that everytime I use the redirect the https is converted to http.\r\nFor example in any action if I add something like this: \r\nYii::$app->getResponse()->redirect('/site/index'); \r\nThe request don't keep the https and I get a request like this http://domain.com/site/index instead of https://domain.com/site/index\r\n\r\nI redirect every url from http to https in my htaccess but since my website should run in an canvas page in facebook I can't have any request that use http and at the moment I can't put is running on facebook\r\n"},"comment":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/comments/121718555","html_url":"https://github.com/yiisoft/yii2/issues/9116#issuecomment-121718555","issue_url":"https://api.github.com/repos/yiisoft/yii2/issues/9116","id":121718555,"user":{"login":"Faryshta","id":2029247,"avatar_url":"https://avatars.githubusercontent.com/u/2029247?v=3","gravatar_id":"","url":"https://api.github.com/users/Faryshta","html_url":"https://github.com/Faryshta","followers_url":"https://api.github.com/users/Faryshta/followers","following_url":"https://api.github.com/users/Faryshta/following{/other_user}","gists_url":"https://api.github.com/users/Faryshta/gists{/gist_id}","starred_url":"https://api.github.com/users/Faryshta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Faryshta/subscriptions","organizations_url":"https://api.github.com/users/Faryshta/orgs","repos_url":"https://api.github.com/users/Faryshta/repos","events_url":"https://api.github.com/users/Faryshta/events{/privacy}","received_events_url":"https://api.github.com/users/Faryshta/received_events","type":"User","site_admin":false},"created_at":"2015-07-15T19:15:04Z","updated_at":"2015-07-15T19:15:04Z","body":"http://www.yiiframework.com/doc-2.0/yii-helpers-baseurl.html#to()-detail you can use Url::to(['site/index'], true) to generate the url that you will pass to the redirect.\r\n\r\nif you want to have ALL the url to use https by default you can configure http://www.yiiframework.com/doc-2.0/yii-web-urlmanager.html#setBaseUrl()-detail this property on your config/main.php"}}