Basic Setup For Htaccess

Updated: Jan 22, 2026
Version: 1.0
Owner: admin

This setup redirects missing image files (404 images) to a placeholder image during local development and helps avoid broken image issues.


Step 1: Add Placeholder Image Rule

Add the following code at the top of the .htaccess file:


FileETag None RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule \.(jpg|jpeg|png|gif|svg)$ http://localhost/download.PNG [NC,R,L]




Step 2: If Site Starts Downloading File Automatically

If opening the site causes the placeholder image to download automatically:

  • Delete the .htaccess file from the root folder

  • Reload the website

  • Recreate .htaccess by saving Permalinks again if required