Answer the question
In order to leave comments, you need to log in
Why doesn't .htacces ban execute php work?
The task would seem to be banal to the point of horror - to prohibit the execution of php in a certain folder of the site, for example: /upload/
I make .htaccess with the following content:
RemoveHandler .php
RemoveType .php
AddType application/x-httpd-php-source .php
Options -ExecCGI -Indexes
php_flag engine off
Answer the question
In order to leave comments, you need to log in
In my notes, these directives are indicated
# запретить доступ ко всем файлам
<FilesMatch ".*">
Order allow,deny
Deny from all
</FilesMatch>
# Разрешить доступ только к файлам определенного расшерения
<FilesMatch "\.(jpg|png|gif)$|^$">
Order deny,allow
Allow from all
</FilesMatch>
# Выключим php
php_flag engine 0
# для все стремных файлов сделаем тип html
RemoveHandler .*
AddType "text/html" .php .cgi .pl .fcgi .fpl .phtml .shtml .php2 .php3 .php4 .php5 .asp .jsp
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question