CakePHP | Redirect from http to https URL

Author - Kailash

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);
Webner Solutions is a Software Development company focused on developing Insurance Agency Management Systems, Learning Management Systems and Salesforce apps. Contact us at dev@webners.com for your Insurance, eLearning and Salesforce applications.

Leave a Reply

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

Send your message