Just moved servers, and existing code is now showing a strange issue.
The point of the code is to catch a 'secure' blackhole error, and redirect it to the secure version of that page. It was doing it on the old server, but is now acting strange.
// App Controller
public function beforeFilter() {
$this->Security->blackHoleCallback = 'blackhole';
}
public function blackhole($type) {
switch($type) {
case 'secure':
debug(Router::url($this->here, true));
exit;
$this->redirect('https://' . env('SERVER_NAME') . $this->here);
break;
}
}
The debug shows: `http://www.example.com/'
But my browser shows 'https://www.example.com/' (notice the S)