Search code examples
phpapache.htaccess

Disable PHP in directory (including all sub-directories) with .htaccess


I'm making a website which allows people to upload files, html pages, etc... Now I'm having a problem. I have a directory structure like this:

-/USERS
    -/DEMO1
    -/DEMO2
    -/DEMO3
    -/etc... (every user has his own direcory here)
-index.php
-control_panel.php
-.htaccess

Now I want to disable PHP, but enable Server-side includes in the direcories and subdirectories inside /USERS

Can this be done (and if so, how)?

I use WAMP server


Solution

  • Try to disable the engine option in your .htaccess file:

    php_flag engine off