CakePHP | Redirect from http to https URL

|
| By Webner

If you want to redirect from http to https in CakePHP, generally redirect method code is like this:

$this­->redirect(array("controller" => "myController","action" =>t; "myAction"));

But if your site is running on http protocol it will redirect to the url with http protocol:

‘http://www.kailash.com/myController/myAction’

If you want to redirect it to https url write code as:

$this­->redirect(https://www.kailash.com/myController/myAction);

Leave a Reply

Your email address will not be published. Required fields are marked *