Allow downloading of INI files in .htaccess

Viewed 105

My website on Debian 9 doesn't allow to download any .ini files located in any folders. How to allow downloading of .ini files at least from a specific folder using .htaccess?

1 Answers

You should ideally find where and how these files are being blocked as it may require additional steps to "unblock". However, you can try something like the following in the .htaccess file in the directory that you want to permit access to all .ini files:

<Files "*.ini">
Require all granted
</Files>

Update from OP:

In error.log I see the following:

ModSecurity: Access denied with code 403 (phase 2). Matched phrase ".ini/" at TX:extension.

I can solve this problem by adding a new directive for Apache:

<IfModule mod_security2.c>
SecRuleRemoveByTag CWAF
</IfModule>
Related