Forum Moderators: phranque

Message Too Old, No Replies

AddType and php_value auto_append_file

Is <FilesMatch> needed?

         

dhiggerdhigger

2:03 pm on Mar 17, 2005 (gmt 0)

10+ Year Member



Hi all,

I thought that

AddType application/x-httpd-php .ext

meant "parse .ext files for php code".

I thought that

<FilesMatch "\.(ext)$">
php_value auto_append_file "/the/path/that/leads/to/filewithphpcode.php"
</FilesMatch>

meant "add the filewithphpcode.php code to .ext files".

But apparently this also works:

AddType application/x-httpd-php .ext
php_value auto_append_file "/the/path/that/leads/to/filewithphpcode.php"

The FilesMatch is left out. I suppose making a php_value auto_append_file
command without <FilesMatch> means "add this to anything you're parsing for php".

Is this correct? Is one way more correct than the other? Are there any problems with this shorter method?

Thanks
Dave Higgins

sitz

2:47 am on Mar 25, 2005 (gmt 0)

10+ Year Member



Yes, that should be fine. As an added bonus, the shorter method, assuming it /does/ work, will actually be a tad (but only the slightest of most-likely-unmeasureably-small tads) faster, since Apache won't have to perform the regular expression match.