Skip to content

Instantly share code, notes, and snippets.

@blazindrop
Last active December 30, 2015 12:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blazindrop/7828026 to your computer and use it in GitHub Desktop.
Save blazindrop/7828026 to your computer and use it in GitHub Desktop.
Drush command to resave your .htaccess files for upgrade to 7.24
### CD into top level sites directory; change owner writable so drush can write new file
### find -maxdepth 3 -name .htaccess -printf "%p %M\n" -exec chmod u+w '{}' \;
# public directory
drush @sites eval 'file_create_htaccess(variable_get("file_public_path"),FALSE,TRUE);'
# private directory
drush @sites eval 'file_create_htaccess(variable_get("file_private_path"),TRUE,TRUE);'
# temp directory (some platforms only need to run this on one site for shared temp directories)
drush @sites eval 'file_create_htaccess(variable_get("file_temporary_path"),FALSE,TRUE);'
### change permissions back
### find -maxdepth 3 -name .htaccess -printf "%p %M\n" -exec chmod u-w '{}' \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment