404 after deployment of a Symfony project

  symfony, symfony4

I have just deployed my application on the server.

On localhost I can use the URL http://localhost:80/autofill/has-data and I get an output. On the live server, I use the URL http://example.com/backend/autofill/has-data and I get a 404 error message.

My whole Symfony project is in the directory backend.

This is how my controller looks like:

/**
 * @Route("/autofill/has-data", methods={"GET"})
 * @return Response
 */
public function hasData() {
    $hasEnoughData = ($this->autofillService->hasEnoughData()) ? 1 : 0;
    return new Response($hasEnoughData);
}

Why do I get this 404 error?

Source: Symfony Questions

LEAVE A COMMENT