I had multisite previously, two sites sharing same codebase like but having their own files system: -
- site1 -> sites/site1/files/FILES_HERE
- site2 -> sites/site2/files/FILES_HERE
Now I am trying to separate the sites to its own sites and separate codebase to use the normal Drupal structure like: -
- site1 -> sites/default/files/FILES_HERE
- site2 -> sites/default/files/FILES_HERE
but somehow whenever I clear the cache, it creates folder like: -
- site1 -> sites/site1/files
and uses this instead of
To overcome that I added some config in settings.php file
$conf['file_public_path'] = 'sites/default/files/'; $conf['file_temporary_path'] = '/tmp';
Now, the site1 uses proper file i.e.
/sites/default/files but it creates .htaccess files inside
sites/default/files/ folder. The .htaccess file contains:
# Turn off all options we don't need. Options None Options +FollowSymLinks # Set the catch-all handler to prevent scripts from being executed. SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 <Files *> # Override the handler again if we're run later in the evaluation list. SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 </Files> # If we know how to do it safely, disable the PHP engine entirely. <IfModule mod_php5.c> php_flag engine off </IfModule>
The images in the website doesn't load properly because of this file. If I delete this file the Images load properly, but while clearing the cache the file is auto generated and again the image doesn't load.
File permission is not an issue here as its 775 universal except for settings.php file.