Hello,
I have a drupal 8 site being deployed to live server.
I installed Advanced CSS/JS Aggregation to minified and combine css & js into one file. When css & js is aggregated, a new css file is created in
"sites/default/files/css/css_hXUAq2PGK9p4je0X4bXRmI0PGqgBcVwcHZqKVLddhEk.css?q564dg". When I make changes to css file, I flush all caches in drupal, a new version of aggregated css file will be regenerated inside sites/default/files/css. However, I found that whenever I flush all caches, .htaccess inside sites/default/files is updated automatically.
Original .htaccess:
# Turn off all options we don't need.
Options -Indexes -ExecCGI -Includes -MultiViews
# 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>
Updated .htaccess:
##### below lines were added into .htaccess #####
# Deny all requests from Apache 2.4+.
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
# Deny all requests from Apache 2.0-2.2.
<IfModule !mod_authz_core.c>
Deny from all
</IfModule>
########################################
# Turn off all options we don't need.
Options -Indexes -ExecCGI -Includes -MultiViews
# 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>
when the extra lines were added, all the files in /sites/default/files are not accessible.
Other than that, I also installed `Asset Injector` to inject custom css and js into pages. Not sure if this module cause the issue.
I couldn't find any related issue from google.
Does anyone have any idea about this issue?