0

I have a Magento site (2.4.3) running on Ubuntu with Apache. I am creating eBay listings which are using images from the https://<mysite.com>/images folder. The images are not displayed. If I try to open the URL https://<mysite.com>/images/MyImage.jpg, I am displayed the Magento 404 page.

My .htaccess file is the default version

RewriteCond %{REQUEST_URI} !^/pub/
RewriteCond %{REQUEST_URI} !^/setup/
RewriteCond %{REQUEST_URI} !^/update/
RewriteCond %{REQUEST_URI} !^/dev/
RewriteRule .* /pub/$0 [L]
DirectoryIndex index.php

If I add this code to the file, I can get the images to work but it breaks the Magento site. Note: I've added spaces as the second character of line 1 and 3 below because I could not get the code to display correctly without them.

< Directory "Your directory path/images/">

   Allow from all

< /Directory>

How do I resolve this?

0

I was able to resolve this one myself with a little trial and error. I added a line into the .htaccess file so it now looks like this:

RewriteEngine on
RewriteCond %{REQUEST_URI} !^/pub/
RewriteCond %{REQUEST_URI} !^/setup/
RewriteCond %{REQUEST_URI} !^/update/
RewriteCond %{REQUEST_URI} !^/dev/
RewriteCond %{REQUEST_URI} !^/images/.*$   <-- Added this line
RewriteRule .* /pub/$0 [L]
DirectoryIndex index.php

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.