Magento 媒体 url 不工作

Magento media url not working

我想澄清一下我已经经历过这个post:

Magento media url - get rid of 403 Forbidden

但我仍然无法从媒体库中获取图像 url。我已经尝试了所有这些网址:

localhost/magento/media/customer/pic1.jpg (access forbidden error)
localhost/magento/media/index.html/customer/pic1.jpg (object not found error but image is present)
localhost/magento/media/index.html (working but of no use)

正确的 link 是 localhost/magento/media/customer/pic1.jpg。 尝试设置正确的文件所有权和权限。 对于 apache2 服务器默认配置:

chown -R www-data:www-data /var/www/html/magento
find /var/www/html/magento/media/ -type f -exec chmod 600 {} \;
find /var/www/html/magento/media/ -type d -exec chmod 700 {} \;

我必须制作一个与媒体文件夹相同的 index.html 和 .htaccess 文件(如我引用的 link 中),并将其也放在 media/customer 中。它现在已经修复并与 url 一起工作:localhost/magento/media/customer/pic1.jpg.