• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

.htaccess php_flag engine off

grumpydev

New Pleskian
I am attempting to disable php in a directory and it is not working. Can anyone please show me the error of my ways as this "should work"!?

.htaccess
php_flag engine off
deny from all
<Files ~ "^[a-zA-Z0-9_-]+\.(gif|jpe?g|png|xls|docx?|pdf)$">
order deny,allow
allow from all
</Files>

This is plesk 11.09 #28 on Centos 5.8
nginx reverse proxy to apache running mod_php (doesn't work with FastCGI either)

Any help is greatly appreciated as I have tried everything to get this to work. The basic idea is that I have a directory where uploaded files are copied (yes, i know i should be performing better validation, filtering - this is coming, in the mean time i need to ensure no PHP can be served).
 
OK - so i figured this out. The domain i was trying to utilize this on was on a customized plan. After i clicked "unlock and sync" it got the necessary changes.
 
Ok - so, it did correctly stop executing the .php file extension, however it did not turn off the php engine so that issue still remains.

Any ideas why

php_flag engine off

does not work?

UPDATE:
I think the issue might be because of suexec
 
Last edited:
Back
Top