Forum Moderators: phranque

Message Too Old, No Replies

.htaccess and SetEnv

need to turn off mod_deflate for 1 file only

         

sned

7:01 pm on Apr 8, 2005 (gmt 0)

10+ Year Member



Hi, I have a script that takes a long time to run, I want to flush various bits and pieces back to the user as the script runs. It worked fine, but then I turned on mod_deflate, and now the entire script runs before any data is returned. I think it is possible to turn off mod_deflate for this one file alone, but I'm running into errors with the .htaccess.

The error is: .htaccess: SetEnv not allowed here

Is there something I have to change in Apache's Directory configuration?

Here's the Apache Directory config:

<Directory "whateverdir">
Options -Indexes FollowSymLinks
AllowOverride AuthConfig
Order allow,deny
Allow from all
</Directory>

Here's my .htaccess file:

AuthUserFile /filename
AuthName "authname"
AuthType Basic

<Limit GET POST>
require valid-user
</Limit>

<Files long_processing_time.php>
SetEnv no-gzip 1
</Files>

I hope this is something pretty basic ... Thanks for your help.

-sned

jdMorgan

2:37 am on Apr 9, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



From the documentation:

SetEnv
Context: server config, virtual host, directory, .htaccess

So, SetEnv is not allowed in a <Files> container.

Another way to do it would be:


SetEnvIf Request_URI "^/long_processing_time\.php$" no-gzip

Jim