When I get to the URL http://www.example.com/payments/add/2 , it should automatically redirect to https://www.example.com/payments/add/2 .
Note. I installed ssl on my server.
if($this->params['action']=='add' && $this->params['controller']=='payments') { $this->redirect('https://' . env('SERVER_NAME') . $this->here); }
This code does not work. Please, help
source share