Skip navigation
Help

file_ensure_htaccess

7 file.inc file_ensure_htaccess()

If missing, create a .htaccess file in each Drupal files directory.

Related topics

2 calls to file_ensure_htaccess()

File

drupal/includes/file.inc, line 464
API for handling file uploads and server file management.

Code

function file_ensure_htaccess() {
  file_create_htaccess('public://', FALSE);
  if (variable_get('file_private_path', FALSE)) {
    file_create_htaccess('private://', TRUE);
  }
  file_create_htaccess('temporary://', TRUE);
}