I have a site that has some strict requirements for SEO purposes.
The main one is redirecting all http requests to https which I have done by adding this into the AppController:
public function forceSSL() { return $this->redirect('https://' . env('SERVER_NAME') . $this->here);}public function beforeFilter() { $this->Security->blackHoleCallback = 'forceSSL'; $this->Security->requireSecure();}
The issue I have is with 404 pages, they do not redirect to https (eg. www.hublink.net/asdfg)
I have also added these 2 lines to the .htaccess file (from another post), and removed the above code but then get a "redirect loop" error
RewriteCond %{HTTPS} !=on [NC]RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]