Posted on

Magento 2 category image 404 with store code in url

I have a phtml file in my theme that is added to category page via XML updates tab.

I read image in phtml like so:

$this->getUrl(‘media/catalog/category/’).$_category->getImageUrl()

My theme has 2 store view nl-be, fr-be and one of them has store code to url like so:

NL-BE = https://magento2.com/media/catalog/category/image.jpg

NL-FR = https://magento2.com/fr-be/media/catalog/category/image.jpg //THIS IMAGE GOES 404

Anyone any idea?

Leave a Reply

Your email address will not be published.