I recently struggled with a production issue that didn't happened with symfony's built-in webserver on my development environment. I defined a /projects/{slug} route and put assets in the web directory that are accessible with the url /projects/{slug}/1.jpg.

This works like a charm with symfony's built-in webserver but will fail on production. Indeed, apache will detect that a directory exists for the /projects/project_1 request and redirect it to /projects/project_1/ (notice the slash at the end). This second request will be forwarded to symfony's app.php (due to rewrite rule defined in web/.htaccess) - but since this URL doesn't match any defined route, symfony will throw a 404 error.

The solution belongs in the vhost configuration file: all you have to do is to add the DirectorySlash Off directive to disable apache's redirect.