22 lines · 667 B
Raw Download
1
# Protect uploaded files: never execute them, never list them, and never serve
2
# them raw over HTTP. The application reads them from disk with PHP and renders
3
# a highlighted view instead.
4
5
# Disable PHP execution (covers several handler configs).
6
<IfModule mod_php.c>
7
    php_flag engine off
8
</IfModule>
9
<IfModule mod_php7.c>
10
    php_flag engine off
11
</IfModule>
12
<IfModule mod_php8.c>
13
    php_flag engine off
14
</IfModule>
15
16
# Also neutralise scripts by handler, in case the engine flag is unavailable.
17
RemoveHandler .php .phtml .php3 .php4 .php5 .php7 .phps .cgi .pl .py
18
AddType text/plain .php .phtml .php3 .php4 .php5 .php7 .phps
19
20
Options -Indexes
21
Require all denied
22