public files config in settings.php creates .htaccess file 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 /sites/default/files

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
&lt;Files *&gt;
  # Override the handler again if we're run later in the evaluation list.
  SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003
&lt;/Files&gt;

# If we know how to do it safely, disable the PHP engine entirely.
&lt;IfModule mod_php5.c&gt;
  php_flag engine off
&lt;/IfModule&gt;


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.
The main culprit was extra trailing / in the files path in settings.php file. Which I changed to 

$conf['file_public_path'] = 'sites/default/files';
$conf['file_temporary_path'] = '/tmp';


And deleted the .htaccess file, now the files inside sites/default/files are readbale by server even after clearing the cache.