I have developed a cakephp site that should use ssl for all pages. It works as expected except when I use redirect in a controller it redirects to http: //subdomain.domain.com not https: //subdomain.domain.com/controller/action.
I have solved this by creating a virtual host for port 80 pointing to the cakephp application and added these rewrite rules in .htaccess
RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L]
This catches this situation and redirect to https but this gives unnecessary extra traffic to the server.
The cause for this extra traffic is the redirect function as it generates wrong urls. I have looked into the redirect function and it calls router::url to create the actual url. However I am not able to figure out how or where to instruct the router to use https not http.
Tim