A1Gard
A1Gard

Reputation: 4168

Disable php for all sub Subdirectorys only with .htaccess

I need disable php script in sub folder only not in root index.php .

for example my files :

index.php
test.php
1/index.php
2/index.php
class/*.php
2/test.php
.../... .php

I want disable all php file except index.php in root and class dir .

i try for index root :

php_flag engine off

<Files index.php>
    php_flag engine on
</Files>

But this enable all file with index.php .

now how I can disable all sub folder expect class and all file expect index.php in root ?

Upvotes: 0

Views: 354

Answers (1)

user1781710
user1781710

Reputation:

I don't get it. Why would you need to have PHP files in a directory if only to disable the PHP processing of the files. Rename the files .txt or something and lock the directory permissions so no one can access it.

Upvotes: 1

Related Questions