How to make https: // with cakephp 3 router :: url

My Code :-

Output : - http://host/project_name/controller_name/function_name

What I need is :- https: //host/project_name/controller_name/function_name

Looking at the code of that function, seems you can set '_ssl' => true or '_scheme' => 'https' in your URL array.

You should configure App.fullBaseUrl to use https

1 Like

I was going to include that, but I misread the code and thought the function used the base from the current URL instead of that configuration. This is definitely the best way to go if it’s acceptable to use HTTPS for all traffic (which should cover the majority of use cases).

Using ‘_ssl’ = true need to be set everywhere I used Router::url. Hence to avoid it, I configured App.fullBaseUrl to https. It worked. :+1:

Thanks for help.