V
V
Vadim2014-02-05 21:31:20
PHP
Vadim, 2014-02-05 21:31:20

Why is php not being disabled in a directory via .htaccess?

There is a folder for files, it contains .htaccess with such content

php_flag engine Off
RemoveHandler .php .php2 .php3 .php4 .php5 .phtml .pl .rb .py .cgi .fcgi .fpl
AddType application/octet-stream .php .php2 .php3 .php4 .php5 .phtml .js .html .htm .xhtml .shtml .pl .rb .py .css .sass .less .coffee .cgi .fcgi .fpl
Options -Indexes

On the local (open-server, apache 2.4.6) everything is ok, but on the server (apache 2.2.26 + nginx 1.5.9 for statics) the scripts are executed. Tell me what could be the problem.
PS: AllowOverride All, since rewrite and other options work in .htaccess

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrew, 2014-02-06
@kaasius

Close at the nginx level
location /your_folder {
try_files $uri $uri/ 404;
}
Something like this. It will give all the files from this location without the participation of Apache at all. And accordingly, no scripts will be executed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question