Pergunta

we are deflating the php files for compression, performance, etc.

the .htaccess file syntax goes like this:

<Files *.php>
     SetOutputFilter DEFLATE
</Files>

now we have one file getsong.php which basically serves mp3s. i dont want this file to be inflated because our flash mp3 player seems to have problem in un-compressing the served mp3 and is not giving correct play duration of the mp3 file,etc.

as a quick-fix, i would like to change this <files> directive so that it excludes the getsong.php. i've tried various regular expressions but failed badly. can u plz tell me how to write regular expression for this within the files directive or should i use filesmatch?

any other ideas on how to handle this problem are also welcome :)

Foi útil?

Solução

I would expect something like this to work:

<Files *.php>
     SetOutputFilter DEFLATE
</Files>
<Files youronefile.php>
     SetOutputFilter NONE (or something)
</Files>

If that doesn't work, remember to use <FilesMatch> with your regular expression :)

Outras dicas

Try that for your .htaccess:

<FilesMatch "(.*[^getsong])\.php">
SetOutputFilter DEFLATE
</FilesMatch>

I assume that you use Apache >= 1.3

// EDIT:
just did it the wrong way :) :p.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top