Problem Description
- You're using a web application (ex: PrestaShop or WordPress Multisite) and/or you have a .htaccess file with static file or image path rewrites
- All or some images (and other static files like CSS files) are not showing / loading on your website (for PrestaShop it's only product images).
- You're using software that dynamically creates a file that, based on its file extension, should be static and therefore should be found as a file on the server (example: a file called ads.txt)
- When you check the browser console or server logs, it shows 404 errors when loading images or other static files. The browser console and server log will provide the path to the image. When you check the path to the image file on the server using Plesk File Manager or FTP, the image really doesn't exist at that location
This means that your site is attempting to using apache rewrites to serve the static/image files by feeding their request into PHP - or another server-side language - rather than loading them on disk.
Note: static files are just about any file that doesn't run code, such as .txt, .png, .jpg, css, etc.
If your website's rewrites, found in the .htaccess file, send static file requests to a PHP file like index.php (common in WordPress multisite and other apps), this means every single image request will load a PHP process to handle it, which is poor for website performance, particularly when you have more than a few visitors at once.
Because this type of configuration results in a significant drop in performance, our servers are optimized to provide a basic 404 page when the image file does not exist at the location on disk, thus blocking PHP processing for static resources that require rewrites to load.
Problem Resolution
There are two ways to resolve this:
A) Try to configure the web app / rewrites so that you don't need dynamic processing (usually from PHP) to load the static files
The best solution is to check your web application's documentation and support articles to determine if there is a configuration for the app that will generate your site's HTML using the correct URLs to the image path on disk, rather than using a fake/friendly URL that then needs PHP processing to load them.
Example for Prestashop: in the admin, go to Preferences (or Shop Settings) > SEO & URLs > Disable Friendly URLs
B) Lose the performance optimization by disabling optimized 404 handling:
If there's no way to force the app to use the actual path on disk for these files (boo!), you can bypass our optimizations by adding a blank file called .dynamic404
(it must be preceeded with a dot) in your website's web root folder (for primary domains, this is usually within httpdocs).
IMPORTANT NOTE: If you use option (2) and you have an increase in traffic your site will very likely exhaust its PHP resources fast. If this occurs, your only good solution is to migrate to a VPS. On the flip side, if you find a way to directly link to the file on disk, your site will very likely be able to handle far more traffic without requiring an upgrade of service.