at magento admin base url static and base url media are on http://domein.nl/static/ and http://domein.nl/media/ new photos are saved properly in pub/media/catalog/products//

however on the website the photos of the product page are requested via the path pub/media/catalog/products/* instead of media/catalog/products/* so with starting with pub instead of media.

the result is that the call is wrong and so no photos are shown because the path is not correct.

some things have been changed for security on the server according to the following method: https://experienceleague.adobe.com/docs/commerce-operations/installation-guide/tutorials/docroot.html

Anyone have any idea how I can correct this?

  • Please check the rewrite module is enabled. And can you attach your site URL?
    – Wang Gang
    Jan 11 at 20:44

1 Answer 1


the solution was adding this to env.php

tail -n7 magento2/app/etc/env.php | head -n 3 'directories' => [ 'document_root_is_pub' => true ],

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.