2

I want to disable the php engine in all directories below the current one.

I have tried using <Directory> and <DirectoryMatch> but cannot find the correct regex syntax for matching just sub directories.

Example directory structure:

files/folder1/ files/folder2/ files/folder3/folder3a

I want to match folder1/, folder2/, folder3/ and folder3a/ but not files/

Any ideas?

2 Answers 2

0

what you're doing here is inverting hierarchy. Everything is designed to work the other way around. My advice would be to change your folder structure so that you don't need to do things backwards.

Perhaps have one folder for your scripts, and enable PHP in that only, and another folder containing everything else.

0

Just in case someone needs it, firstly tell apache to treat your php files as text files by dropping the following directive in the the directory you want:

AddType text/plain .php

Then in all subdirectories under it, turn them back to scripts:

AddType application/x-httpd-php .php

This should work if the lines are in .htaccess files or <Directory> directives

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .