PrestaShop

PrestaShop Domain Change Issues: Fix Missing Images & Broken Product Pages

Changing your PrestaShop store's domain name is a significant step, often driven by rebranding efforts, a full-scale migration, or simply updating your online presence. While the initial domain mapping through your hosting panel (like Plesk, cPanel, or others) might seem straightforward, PrestaShop, being a robust e-commerce platform, often requires specific internal adjustments to function flawlessly under its new address.

A common and particularly frustrating issue users encounter post-domain change is the disappearance of front-office images and inaccessible product pages, even when the back office appears perfectly normal. This scenario can cause panic, as a broken storefront directly impacts sales and customer trust.

This exact challenge was recently highlighted in a PrestaShop forum thread (Thread #1108362) where a user, JC_, faced these precise symptoms after updating their domain. Their experience and the swift, effective solution provided offer invaluable insight for any PrestaShop merchant or developer navigating a similar scenario. At Migrate My Shop, we understand these complexities, and this guide aims to demystify the process, ensuring your PrestaShop store thrives on its new domain.

PrestaShop back office SEO & URLs page with Friendly URL toggle
PrestaShop back office SEO & URLs page with Friendly URL toggle

The Challenge: A Broken PrestaShop Store After Domain Change

After updating their domain via Plesk, JC_'s PrestaShop front end displayed critical errors:

  • Missing Front-Office Images: Product images, category banners, and other visual assets failed to load, often appearing as broken links or placeholders.
  • Inaccessible Product Pages: Clicking product listings resulted in errors, blank pages, or failed to load the detailed product information.

Crucially, the back office remained fully functional, with all product images displaying correctly within the admin panel. This discrepancy is a key indicator: it suggests a front-end rendering or URL rewriting issue rather than a fundamental problem with image files or database entries themselves. JC_ correctly suspected a "paramétrage quelque part" (some configuration issue) – a common intuition for PrestaShop users.

The root cause often lies in PrestaShop's reliance on its configured base URLs for generating links and asset paths. When the domain changes, but these internal configurations aren't updated, the front office continues to try and fetch resources from the old domain, leading to broken links and a dysfunctional user experience.

The Simple Yet Powerful Solution: Reset & Clear

Forum member ComGrafPL provided a quick and effective solution that immediately resolved JC_'s issues. This fix, while seemingly minor, addresses the core problem of outdated URL references and cached data. It involves a few primary steps, which we'll detail for clarity.

Step 1: Verify and Update PrestaShop's Shop URLs

Before diving into the .htaccess and cache, ensure PrestaShop itself is aware of its new domain. While your hosting panel might redirect, PrestaShop needs its internal settings updated.

  1. Log in to your PrestaShop back office.
  2. Navigate to Shop Parameters > SEO & URLs.
  3. Scroll down to the "Set shop URL" section.
  4. Verify that "Shop domain" and "SSL domain" (if applicable) are set to your new domain name.
  5. Ensure the "Base URL" is correct (e.g., / if PrestaShop is in the root directory).
  6. If any changes were made, click "Save".

Expert Tip: For more complex migrations or if you can't access the back office, these URLs can also be updated directly in your database, typically in the ps_shop_url table. Always back up your database before direct edits!

Step 2: Resetting the .htaccess File via Friendly URLs

The .htaccess file is crucial for PrestaShop's URL rewriting, enabling "Friendly URLs" (e.g., yourstore.com/product/my-awesome-product instead of yourstore.com/index.php?id_product=123). When you change your domain, the rewrite rules within this file might still point to the old domain or become invalid. Toggling the Friendly URL setting forces PrestaShop to regenerate this file with the correct, updated paths.

  1. From your PrestaShop back office, go to Shop Parameters > SEO & URLs.
  2. Find the "Friendly URL" option.
  3. Disable Friendly URLs (toggle it to "No").
  4. Click "Save".
  5. Once saved, Re-enable Friendly URLs (toggle it back to "Yes").
  6. Click "Save" again.

This action effectively "refreshes" your .htaccess file, ensuring all internal links and asset paths are correctly rewritten for your new domain.

# Example of a regenerated .htaccess rule (simplified)
# Old: RewriteRule . - [E=REWRITEBASE:/old-domain-path/]
# New: RewriteRule . - [E=REWRITEBASE:/new-domain-path/]

This process ensures that your web server (Apache, or Nginx configured to use .htaccess rules) correctly maps the new domain's requests to the appropriate PrestaShop resources.

Step 3: Clearing the PrestaShop Cache

PrestaShop extensively uses caching to improve performance. After a domain change, this cache can hold outdated URLs, image paths, and template compilations that still refer to your old domain. Clearing it forces PrestaShop to rebuild these cached assets with the new, correct information.

  1. From your PrestaShop back office, navigate to Advanced Parameters > Performance.
  2. At the top right, you'll see a button labeled "Clear cache". Click it.

This action clears all compiled templates, Smarty cache, and other cached data stored in your var/cache directory, ensuring PrestaShop serves fresh content based on your updated configurations.

Step 4: Clear Your Browser Cache

Finally, after performing the above steps, it's crucial to clear your own browser's cache. Your browser might still be holding onto old CSS, JavaScript, and image references from the previous domain, preventing you from seeing the immediate fixes. A hard refresh (Ctrl+F5 or Cmd+Shift+R) or clearing your browser's cache completely is recommended.

Why This Works: Understanding the PrestaShop Ecosystem

PrestaShop's architecture relies on a delicate interplay of database settings, file system configurations, and server rewrite rules. When you change a domain:

  • Database URLs: The ps_shop_url table stores the base URLs PrestaShop uses to generate links throughout your store.
  • .htaccess File: This Apache configuration file (or equivalent for Nginx) dictates how URLs are processed and rewritten. It needs to reflect the current domain for friendly URLs and asset paths to function.
  • Cache: PrestaShop's Smarty templating engine and other caching mechanisms store compiled versions of pages, including hardcoded paths. If these aren't cleared, the old paths persist.

The solution provided by ComGrafPL (and expanded upon here) systematically addresses these points, ensuring all layers of your PrestaShop installation are synchronized with your new domain.

Beyond the Quick Fix: Best Practices for Domain Changes

While the above steps resolve the most common issues, consider these best practices for a smoother domain transition:

  • Full Backup: Always perform a complete backup of your PrestaShop files and database before making any significant changes.
  • Staging Environment: Ideally, perform domain changes and test them on a staging environment first. This allows you to identify and fix issues without impacting your live store.
  • SEO Considerations: Implement 301 redirects from your old domain to your new one to preserve SEO rankings and guide returning customers. Update Google Search Console and other webmaster tools.
  • Third-Party Modules/Themes: Some highly customized themes or modules might have hardcoded URLs. If issues persist, investigate these.
  • CDN Configuration: If you use a Content Delivery Network (CDN), ensure its configuration is updated to point to your new domain.

JC_'s quick resolution in the forum thread is a testament to the power of the PrestaShop community and the effectiveness of these core troubleshooting steps. By understanding and applying these solutions, you can confidently navigate domain changes for your PrestaShop store, ensuring a seamless experience for both you and your customers.

If you're planning a more extensive PrestaShop migration or facing persistent issues, don't hesitate to reach out to the experts at Migrate My Shop. We specialize in smooth, hassle-free PrestaShop migrations and can help ensure your e-commerce journey is successful.

Share:

Start with the tools

Explore migration tools

See options, compare methods, and pick the path that fits your store.

Explore migration tools