Archive

Posts Tagged ‘php_flag’

Turn Off PHP Parsing In A Directory

December 23rd, 2008 No comments

Sometimes it is necessary to turn off PHP parsing for a directory. You might want to give away some source code and therefore don’t want to parse that code when the user tries to download it.

To turn off PHP parsing in a directory just create a .htaccess file with the following content.

php_flag engine off

You can expand on this by adding the following:

AddType text/plain .php

This will force all files to be served as plain text files.

If you are going to use this then be sure that you do not put this in any directory that contains your applications. This will cause your files to be downloadable, including any files with usernames and passwords in.