Timeline for Magento 2.3 : Serving site from pub, now images get 404
Current License: CC BY-SA 4.0
8 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Feb 8, 2019 at 15:06 | comment | added | jtlindsey | I do not have any custom modules or custom code implemented beyond manually fixing upload image issue magento.stackexchange.com/a/255782/75936 | |
Feb 8, 2019 at 14:41 | comment | added | HelgeB |
It seems like you have some customaziation there. The default Magento method for category images getImageUrl in Magento\Catalog\Model\Category has a hardcoded 'catalog/category' path and can't return such a path. If you have a custom module, try to find out how that's involved and if that stores the custom path when you upload an image. So it might be that you have some pathes with 'pub' in your database
|
|
Feb 8, 2019 at 14:25 | comment | added | jtlindsey | yes, the image is broken in admin area too. "media/Shoes is not a magento default directory". If I create a category in the backend named 'Shoes", and upload a image to the category content area. that image becomes domain/media/<Cagtegory>/<image>.png. or domain/media/Shoes/nike.png | |
Feb 8, 2019 at 14:05 | comment | added | HelgeB | media/Shoes is not a Magento default directory. The default directory for category images uploaded in the content area of the category in the admin panel is media/catalog/category. Have you uploaded the image nike.jpg as "category image" in the admin panel? do you see the image now in the admin panel or at least a broken image there? | |
Feb 8, 2019 at 13:53 | comment | added | jtlindsey | Images where uploaded before serving from pub. To upload image (in this case, to a category) I went to the category, clicked content, clicked upload. Note from my original...everything worked normally before serving from pub. All i did was change DocumentRoot to serve from pub. I did not upload anything after making serve from pub so if the issue is with default upload directory, it should have showed a problem before serving from pub shouldn't it? Given i haven't uploaded any new images after modifying document root? | |
Feb 8, 2019 at 12:32 | comment | added | HelgeB | ok, can you please provide more information where this image come from? If it is referenced in a cms block, please paste the code in your question. By default magento uploads category images to 'media/catalog/category' directory, images from CMS upload are in 'media/wysiwyg'. Do you get product images with the correct path? | |
Feb 8, 2019 at 12:13 | comment | added | jtlindsey | I never set images to "pub" anywhere. I uploaded them via the admin GUI while working on categories. I followed the directions exactly from the docs for serving from root. Before serving from pub. images were working. after following docs, images not working. | |
Feb 8, 2019 at 8:15 | history | answered | HelgeB | CC BY-SA 4.0 |