Hello guys,
I have checked some posts on this topic but nothing seems to work and I did not find a clear response.
Let me first explain the context :
1 - I have a VPS at OVH
2 - I have installed my apache2 server quite a long time ago, working with slim using HTTP
3 - Recently I wanted to attached a webhook from a website to my server, but the webhook is only working with HTTPS protocol
4 - I decided to move my apache2 server to https, which I did and now I can access the content from HTTPS location.
BUT
The only thing that is working is the home page :
$app->get(’/’, function ($request, $response, $args) {
$data = array();
return $this->view->render($response, 'layout.html', $data);
})->setName(‘layout’);
When I try to reach the login page, it’s not working, and I get a “Not Found” response from Apache :
“The requested URL /login was not found on this server.”
$app->get(’/login’, function ($request, $response, $args) {
return $this->view->render($response, 'login.html', $data);
})->setName(‘login’);
and to be more precise, no other route thant “/” is working.
I am guessing that somehow Slim is not referencing routes in https ?
I have to admit this is the first time I am using HTTPS so I am kind of lost
I have tested multiples solutions (without really undestanding I have to admit) :
- .htaccess changed : How to redirect to HTTPS using SLIM 3
- Slim config : adding
container['environment'] = function () { _SERVER[‘HTTPS’] = ‘on’;
return new Slim\Http\Environment($_SERVER);
};
Any idea to come back to route working in https ?