addhandler ONLY for one Directory

Discussion in 'Apache' started by chris2009, Feb 20, 2009.

  1. #1
    Hi,
    i try to make all .php in my ROOT to be processed as php5

    BUT (and thats tricky for me) ONLY in the directory
    NOT in its Subdirectories.

    I tried in .htaccess

    <directory "/home/gumandi/www.gumandi.com">
    AddHandler php-fastcgi5 .php
    </directory>

    but that only brought a INTERNAL SERVER ERROR

    phpinfo give me:

    _SERVER["DOCUMENT_ROOT"] = /home/gumandi/www.gumandi.com/
    _SERVER["SCRIPT_FILENAME"] = /home/gumandi/www.gumandi.com/phpinfo.php

    just to see if my path is right...

    Please do you have any idea???

    just PHP5 on all PHP in the ROOT (not subs) i would be happy :)

    Thanks
    Chris
     
    chris2009, Feb 20, 2009 IP
  2. joebert

    joebert Well-Known Member

    Messages:
    2,150
    Likes Received:
    88
    Best Answers:
    0
    Trophy Points:
    145
    #2
    You'll need to reset/remove the handler in each subdirectory.
    http://httpd.apache.org/docs/1.3/mod/mod_mime.html#removehandler
    Subdirectories inherit their parent configurations unless you override them in the subdirectory.

    You're getting an internal server error for the <directory> container because that container is not allowed in htaccess. The editable context of that container is limited to "server config", and "virtual host".
     
    joebert, Feb 20, 2009 IP