Dev and prod plateform : avoid duplicating /default/files

When you want to refresh your dev environement with data from the production, you need to update the database and the user uploaded files, with is the most boring part if you only use FTP.

You can avoid this step by adding a single line to your htaccess file, or even better, in the virtualhost definition to avoid drupal overriding it on every update.

RewriteRule ^sites/default/files/(.*)\.(jpg|JPG|png)$ https://productionsite.com/sites/default/files/$1.$2 [QSA,R=301,NC,L]

 

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.