12
I am trying to make my administrator actions SSL-protected, including the login action. However, whenever I try to access one of these actions, I always get error 404. For example, when trying to access the login page Cake redirects to https://cakeprebuild.dev/login, with error 404. The apache access log has for each entry, for these actions, "GET /login HTTP/1.1" 302 -, in this case for the login action. I’m not sure if the problem is cake or a bad Wamp setup because this only happens when the project is run as Wampserver Vhost, if I try to run through the localhost, https://localhost/CakePreBuild/login
, everything works perfectly. How can this problem be solved?
I’m using Cakephp 2.4.4 and Wampserver 2.5 64bit
Userscontroller
public function beforeFilter() {
parent::beforeFilter();
$this->Auth->deny('index');
if (isset($this->params['admin'])) {
$this->Security->csrfCheck = false;
$this->Security->blackHoleCallback = 'forceSSL';
$this->Security->requireSecure();
}
}
public function forceSSL() {
return $this->redirect('https://' . $_SERVER['SERVER_NAME'] . $this->here);
}
Hello. Could you post where you load the Authcomponent, the Login Controller and your Routes file? So it will be much easier. I believe it is a permission error in the login controller and it enters Loop.
– Shayllis Alves de Sousa
Please avoid long discussions in the comments; your talk was moved to the chat
– Maniero