0

最近、アプリケーションをサブディレクトリに移動したので、fullBaseUrl を次のように構成しました。

Configure::write('App.fullBaseUrl', 'https://example.com/subdirectory');

アプリに変更はなく、許可されていない場所へのアクセスという 1 つのことを除いて、すべてが完璧に機能します。

私は次のように定義しました:

$this->Auth->loginAction = ['controller' => 'app_users', 'action' => 'login', 'admin' => false];
$this->Auth->loginRedirect = ['controller' => 'dashboard', 'action' => 'index', 'admin' => false];
$this->Auth->logoutRedirect = ['controller' => 'app_users', 'action' => 'login', 'admin' => false];
$this->Auth->unauthorizedRedirect = ['controller' => 'dashboard', 'action' => 'index', 'admin' => false];

したがって、このログに記録されたユーザーは、不正なアクションにアクセスしようとするとダッシュボードにリダイレクトされますが、ログインしていないユーザーはログイン フォームにリダイレクトされる必要があります。

しかし、アプリをサブディレクトリに移動し、許可されていない場所に fullBaseUrl を定義した後、次のようにリダイレクトされます。

https://example.com/subdirectory/subdirectory/app_users/login
4

1 に答える 1