Skip to content

Instantly share code, notes, and snippets.

@itarato
Last active December 8, 2015 10:15
Show Gist options
  • Select an option

  • Save itarato/89f75992bd055c3ac890 to your computer and use it in GitHub Desktop.

Select an option

Save itarato/89f75992bd055c3ac890 to your computer and use it in GitHub Desktop.
Broken image after database clone

Broken images after DB clone

Get a broken image replacement, such as this placeholder and save it to your webserver (available on the same domain).

Add the following entry to Apache (virtual host or .htaccess file):

<IfModule mod_rewrite.c>
    RewriteEngine on

    RewriteCond %{REQUEST_URI} sites/default/files
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^ default.png [L]
</IfModule>

For Drupal the recommendation is to sites/default/files/.htaccess to not to hack core.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment