Images not loading either on direct url or via twig asset function in ezpublish

343 Views Asked by At

eZPublish guide: https://doc.ez.no/display/DEVELOP...p+2+-+Customizing+the+general+layout

I am entering the latest version of eZ after having spent some time a few years ago in version 4.

I have configured a vhost with the sample file from: https://github.com/ezsystems/ezplatform/tree/master/doc/apache2

I have now followed the bike guide and successfully got the system to use the correct css and js from the unzipped assets folder which is now sitting in 'web/assets'. The page loads with the correct CSS and the layout of the page look good.

The guide instructs to load the images using the function asset:

<img alt="Brand" src="{{ asset('assets/images/128_bike_white_avenir.png') }}">

The outcome of the above twig snippet is:

 <img alt="Brand" src="/assets/images/128_bike_white_avenir.png">

The image however refuses to load and will only r

No route found for "GET /assets/images/logo_just_letters.png" (from "http://john.ezpublish.net/") 404 Not Found - NotFoundHttpException 1 linked Exception: ResourceNotFoundException »

Is there a setting somewhere that should be changed, or vhost config change?

1

There are 1 best solutions below

0
On

try to add

RewriteRule ^/assets/ - [L]

under the

RewriteRule ^/bundles/ - [L]

in your vhost (see example) and restart the apache server.