-
-
Save intech/d8acc761c7df2e58c6e5cdecf3d79835 to your computer and use it in GitHub Desktop.
Закрытие директории загрузки от исполнения
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Запрещаем листинг директории | |
Options -Indexes | |
# Здесь мы запрещаем доступ из веба к файлам с расширениями | |
<FilesMatch "\.(php|cgi|pl|php|php3|php4|php5|php6|php7|phps|phtml|shtml|py|phtml|pl|asp|aspx|cgi|dll|exe|ico|shtm|shtml|fcg|fcgi|fpl|asmx|pht|py|psp)$"> | |
Order allow,deny | |
Deny from all | |
</FilesMatch> | |
# Ниже мы говорим, что данные расширения отдавать как текст, чтобы не выполнять как исполняемые файлы | |
# В данном случаи это уже не нужно, т.к. мы запретили доступ выше к данным файлам совсем из веба | |
<IfModule mod_mime.c> | |
RemoveHandler php .php3 .php4 .php5 .php6 .php7 .phtml .pl .asp .aspx .cgi .dll .exe .ico .shtm .shtml .fcg .fcgi .fpl .asmx .pht .py .psp | |
AddType text/plain php .php3 .php4 .php5 .php6 .php7 .phtml .pl .asp .aspx .cgi .dll .exe .ico .shtm .shtml .fcg .fcgi .fpl .asmx .pht .py .psp | |
</IfModule> | |
# Отключаем выполнение php скриптов для php5 | |
<IfModule mod_php5.c> | |
php_flag engine off | |
</IfModule> | |
# Отключаем выполнение php скриптов для php7 | |
<IfModule mod_php7.c> | |
php_flag engine off | |
</IfModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment