Addhandler only for Root Folder

guruk

Verified User
Joined
Feb 20, 2009
Messages
6
Hi,
i would need the .htaccess statement:

AddHandler php-fastcgi5 .php

BUT only for the actual Folder (without Subdirectories)
Right now its my root folder that needs all .php as php5 parsed.
but NOT all it subfolders

I would be also happy if i just can define specific files from my root
(not subs) like index.php, index-e.php, ....

Any Ideas? I tried with <files .. <filesmatch .. but always the statement
works also in the subdirs.. what i dont need.

thanks
chris
 
thanks

do you have a small example
right now i look for this <directory> command
google: <directory> htaccess

but dont find an answer.

thanks
chris
 
<directory "/home/user/domains/domain.com/public_html">
AddHandler php-fastcgi5 .php
</directory>
 
Might try sethandler instead of addhandler too that might be your problem.
 
I would be happy to tell you it works.. looks so logical.

but when I upload it:

i get an INTERNAL SERVER ERROR
and nothing at all works.

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

its the right path i guess
phpinfo give me:

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


hmmm what can it be?

chris
 
and when I understand right .. this <directory> command also would do my addhandler to all SUbdirectories !?!

-- from apache

<Directory> and </Directory> are used to enclose a group of directives that will apply only to the named directory and sub-directories of that directory. Any directive that is allowed in a directory context may be used. Directory-path is either the full path to a directory, or a wild-card string using Unix shell-style matching. In a wild-card string, ? matches any single character, and * matches any sequences of characters. You may also use [] character ranges. None of the wildcards match a `/' character, so <Directory /*/public_html> will not match /home/user/public_html, but <Directory /home/*/public_html> will match. Example:

<Directory /usr/local/httpd/htdocs>
Options Indexes FollowSymLinks
</Directory>
Be careful with the directory-path arguments: They have to literally match the filesystem path which Apache uses to access the files. Directives applied to a particular <Directory> will not apply to files accessed from that same directory via a different path, such as via different symbolic links.
 
:) really thanks for your effort
but i am a total newby with htaccess

how i have to do that with sethandler? (example)

and is it JUST for that directory or also for its subdirectories?
I just need it for that dir and nothing else....

thanks
chris
 
All httpd configuration options that I know of, that work on a directory level, also work on all subdirectories.

If I were you I'd ask on an Apache-oriented forum or even an html-oriented forum; surely others may have figured out a workaround.

Jeff
 
I would try:

<FilesMatch "index.php">
SetHandler php-fastcgi5
</FilesMatch>
 
Back
Top