Disabling php in a folder

Enter Your Query:
Use '%' for wildcards and quotes for "exact phrases"

Top Level » Apache Related Information » Php

Disabling php in a folderLast Modified: Mar 7, 2012, 3:32 pm
If you have a folder below your public_html or private_html directories that you wish to have php disabled in, you can use an .htaccess to do to.

Create the file:


and in it, add the code:

AddHandler text/plain .php .php4 .php5 .php6
php_flag engine off

Which disables php in 2 ways.  The AddHandler changes the php script functionality, chaning php files to simply be txt files.   The 2nd part "php_flag engine off" turns off the php engine.

You can use either one, or both.

Note that with suPhp, you cannot use "php_flag engine off".

© 2018 JBMC Software, Suite 173  3-11 Bellerose Drive, St Albert, AB  T8N 1P7  Canada.  Mon-Fri 9AM-5PM MST