Symfony static image getting 404

I have a symfony site. I have an image at:

/var/www/site/public/images/QR/984746QR.svg

Apache logs give a 404

[27/Oct/2020:13:24:11 +0200] "GET /images/QR/984746QR.svg HTTP/1.1" 404

which according to rewrite rules send it to Symfony:

[27-Oct-2020 11:35:24 UTC] [error] Uncaught PHP Exception SymfonyComponentHttpKernelExceptionNotFoundHttpException: "No route found for "GET /images/QR/984746QR.svg"" at /var/www/site/vendor/symfony/http-kernel/EventListener/RouterListener.php line 136

So I am quite sure its an issue with apache and not Symfony, as it would not even hit Symfony if it was 404

<IfModule mod_rewrite.c>
    RewriteEngine On
RewriteCond %{REQUEST_URI}::$0 ^(/.+)/(.*)::$
    RewriteRule .* - [E=BASE:%1]
    RewriteCond %{HTTP:Authorization} .+
    RewriteRule ^ - [E=HTTP_AUTHORIZATION:%0]

 RewriteCond %{ENV:REDIRECT_STATUS} =""
    RewriteRule ^index.php(?:/(.*)|$) %{ENV:BASE}/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
#tried with and without the following line
#    RewriteCond $1 !^(index.php|assets|images|robots.txt|favicon.ico)
    RewriteRule ^ %{ENV:BASE}/index.php [L]
</IfModule>

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *