My product images are broken after moving to a new server.

Question published 2334 views

After you migrate PrestaShop to a new server, broken product images almost always come down to one of three things: the thumbnails weren't regenerated, the /img/ folder isn't writable, or the shop's domain still points at the old host.

PrestaShop back office, Design > Image Settings, image regeneration tools screen.
Regenerate images from Image Settings after a server move breaks product thumbnails.

Work through these in order:

  1. Regenerate thumbnails. Go to Design → Image Settings and run Regenerate thumbnails. A copied database keeps image records, but the resized files have to be rebuilt on the new disk.
  2. Check folder permissions. The /img/ directory (and its subfolders) must be writable by the web server, or PrestaShop can't write the regenerated files. File ownership often changes during a copy between servers.
  3. Fix the shop domain. If images 404 with the old hostname, update the domain in Shop Parameters → Traffic & SEO and regenerate the .htaccess from SEO & URLs. If you use a CDN, repoint it at the new server too.

This is one slice of a larger move. For the full server/domain checklist, URLs, redirects, SSL and database, see our PrestaShop migration guide; for other post-move symptoms, the troubleshooting guide covers white screens and 500 errors.

Use the browser network panel to separate URL problems from file problems. If the image URL still contains the old domain, fix Shop Parameters > Traffic & SEO > Set shop URL, including the SSL domain and base URI, then regenerate .htaccess. If the hostname is correct but the response is 404, check whether the original file exists under img/p/ and whether image rewrite rules are active.

If the image works directly from the new server but not through the public URL, purge the CDN/reverse proxy and check that it points to the new origin. Mixed http/https image URLs after migration usually mean SSL or base URL settings are inconsistent, not that the product image records are broken.

find img -maxdepth 2 -type d ! -writable -print | head
find img/p -type f -name '*.jpg' | head

image_url='https://example.com/1-home_default/product.jpg'
curl -sI "$image_url" | sed -n '1,12p'

Was this answer helpful?

Still have questions?

Can't find what you're looking for? Send us your question and we'll get back to you.

Loading...
Back to top