Add to Favourites Add to Favourites    Print this Article Print this Article

Disabling php in a folder

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:

.htaccess

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".

Was this answer helpful?

Also Read