Forum Moderators: phranque
<FilesMatch "\.(html?)$">
php_value auto_append_file /server/path/to/my/www_root/subdir/file.ext"
</FilesMatch> will not work unless
<Directory "/server/path/to/my/www_root">
AllowOverride All
</Directory> is placed in httpd.conf?
My hosting provider offered to place the <Directory> block in my <VirtualHost> block, but I understand that a <Directory> block must not be within a <VirtualHost> block. I got my host to put it before the <VirtualHost> block, but then Apache (v1.3.37, with php5 as a CGI) wouldn't restart (error at line... etc, I don't have the error details or the specific line number).
Are we doing anything wrong?
AllowOverride All will trip up out of context, e.g,
[httpd.apache.org...]
Here are the best fit uses for this directive:
[httpd.apache.org...]
cheers, matc
Long reply.....
Aha, so it was applied within a directory block... I got the impression it was stand alone hence the context statement. Also as far as I am aware the httpd.conf parses from the bottom up so if it came across something near the bottom of the file that didn't take then everything else above would fail... ahem .. as ever I’m happy to be corrected
Also just to be clear the Directory directive has the following consideration
“The directory sections occur in the httpd.conf file. <Directory> directives cannot nest, and cannot appear in a <Limit> or <LimitExcept> section.”
Anyway, running apache2, as I haven't used Apache 1.3 in years, and applying a change like this could be tried out like this...
Untested httpd.conf
<VirualHost *:81>
DocumentRoot "/server/path/to/my/www_root"
ErrorLog "/server/path/to/my/logs/error.log"
CustomLog "/server/path/to/my/logs/access.log"
<Directory "/server/path/to/my/www_root">
AllowOveride All
Allow from all # default anyway
Order allow,deny
</Directory>
</VirtualHost>
Something I found out about 'php_value' which might be handy to know is that in apache2 it is best stated as 'php_admin_value' due to a badly documented change between the two versions of Apache and supported PHP releases... as far as I’ve read anyway... Also most implementations of 'php_value' I've seen have been stated in the Directory or DirectoryMatch directives but I can't see why a nested FileMatch within these should do any harm and might make it a bit more tidy..
A suggestion would be to tie the Directory or DirectoryMatch directive to a specifically stated local location path and bundle all the needed staments in that..
Untested httpd.conf
<VirtualHost *:81>
#*... directives ...*
<Directory "/server/path/to/my/www_root/">
AllowOveride All
#*... directives ...*
</Directory>
</Virtualhost>
Untested .htaccess
<Directory “/subdir/”>
<FilesMatch "\.(html?)$">
php_value auto_append_file /server/path/to/my/www_root/subdir/file.ext
</FilesMatch>
</Directory>
This stuff is mostly my stream of consciousness but I hope it helps, theres a few things to try and research further on anyway.
cheers, matc
<Directory "/server/path/to/my/www_root">
AllowOverride All
</Directory>
in my VirtualHost section of the httpd.conf. Unfortunately, I'm still getting notices in my error logs of the command "php_value" not being recognised (when I try to use it in .htaccess):
<FilesMatch "\.(html?)$">
php_value auto_append_file "/home/revise/public_html/count/bbclone.php"
</FilesMatch>
So it hasn't worked. Any ideas why?