You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Pablo Garcia Melga <ma...@gmail.com> on 2010/05/19 15:41:43 UTC

[users@httpd] Header modification problem with mod_rewrite, mod_headers and PHP

Hello,

 I'm struggling with a configuration that doesn't seems to work
I have an httpd 2.2.15 running on RHEL 5.3 loaded with mod_rewrite,
mod_headers, mod_expires and php


I have configured this rewrite rule
RewriteRule "/c([0-9]+)-([a-zA-Z/-]+)-p([0-9]+)(.*)"
"/nl_listado.php?categoria=$1&pagina=$3"

Works fine, no problem.
Now I want to remove all cache-related headers sent by the php and set my own.
So I put these lines in the config.

<Files nl_listado.php>
Header unset set-cookie
Header unset Expires
Header unset cache-control
Header unset Pragma
Header set cache-control "public"
Header append cache-control "max-age=1200"
</Files>
<FilesMatch "/c([0-9]+)-(.*)">
Header unset set-cookie
Header unset Expires
Header unset cache-control
Header unset Pragma
Header set cache-control "public"
Header append cache-control "max-age=1200"
</FilesMatch>

Neither of these seems to work as expected, instead I get a mixed response.

This are the response headers without the sections

Cache-Control: no-store, no-cache, must-revalidate, post-check=0,
pre-check=0, no-cache
Expires: -1
Pragma: no-cache

And this are the response headers after I place the above configuration.

Cache-Control: public, max-age=1200, no-cache
Expires: -1
Pragma: no-cache


I've tried with different versions of httpd, also compiling the
modules statically, but I found no way to make this works.
The weird thing is that the mod_headers kicks in and append the
"public, max-age=1200" to the response, but doesn't remove the
no-cache, Expires and Pragma headers.
Any ideas ?



Regards, Pablo

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] zipping up output of rotatelogs in apache 1.3

Posted by Eric Covener <co...@gmail.com>.
On Wed, May 19, 2010 at 1:45 PM, skrishnamur1@bloomberg.com
<sk...@bloomberg.com> wrote:
> Hi , Is it possible to have TransferLog directive that also zips up the putput file directly from apache without piping to a wrapper script around rotatelogs? Have been doing some research but no luck yet? If you do, let me know. I don't have mod_gziip or mod_deflate either. Thx

You'd have to use a piped logger, the core of apache doesn't know how
to write log entries into a zipfile or periodically zip its old output

-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] zipping up output of rotatelogs in apache 1.3

Posted by "skrishnamur1@bloomberg.com" <sk...@bloomberg.com>.
Hi , Is it possible to have TransferLog directive that also zips up the putput file directly from apache without piping to a wrapper script around rotatelogs? Have been doing some research but no luck yet? If you do, let me know. I don't have mod_gziip or mod_deflate either. Thx

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Header modification problem with mod_rewrite, mod_headers and PHP

Posted by Pablo Garcia Melga <ma...@gmail.com>.
I've tried that also, did't worked either, There seems to be a bug
https://issues.apache.org/bugzilla/show_bug.cgi?id=49308, covering
this issue. But I don't know when it'll be fixed.

On Wed, May 19, 2010 at 7:31 PM, Igor Cicimov <ic...@gmail.com> wrote:
> Use mod_expires instead
>
> Sent from my phone
>
> On May 19, 2010 11:42 PM, "Pablo Garcia Melga" <ma...@gmail.com> wrote:
>
> Hello,
>
>  I'm struggling with a configuration that doesn't seems to work
> I have an httpd 2.2.15 running on RHEL 5.3 loaded with mod_rewrite,
> mod_headers, mod_expires and php
>
>
> I have configured this rewrite rule
> RewriteRule "/c([0-9]+)-([a-zA-Z/-]+)-p([0-9]+)(.*)"
> "/nl_listado.php?categoria=$1&pagina=$3"
>
> Works fine, no problem.
> Now I want to remove all cache-related headers sent by the php and set my
> own.
> So I put these lines in the config.
>
> <Files nl_listado.php>
> Header unset set-cookie
> Header unset Expires
> Header unset cache-control
> Header unset Pragma
> Header set cache-control "public"
> Header append cache-control "max-age=1200"
> </Files>
> <FilesMatch "/c([0-9]+)-(.*)">
> Header unset set-cookie
> Header unset Expires
> Header unset cache-control
> Header unset Pragma
> Header set cache-control "public"
> Header append cache-control "max-age=1200"
> </FilesMatch>
>
> Neither of these seems to work as expected, instead I get a mixed response.
>
> This are the response headers without the sections
>
> Cache-Control: no-store, no-cache, must-revalidate, post-check=0,
> pre-check=0, no-cache
> Expires: -1
> Pragma: no-cache
>
> And this are the response headers after I place the above configuration.
>
> Cache-Control: public, max-age=1200, no-cache
> Expires: -1
> Pragma: no-cache
>
>
> I've tried with different versions of httpd, also compiling the
> modules statically, but I found no way to make this works.
> The weird thing is that the mod_headers kicks in and append the
> "public, max-age=1200" to the response, but doesn't remove the
> no-cache, Expires and Pragma headers.
> Any ideas ?
>
>
>
> Regards, Pablo
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Header modification problem with mod_rewrite, mod_headers and PHP

Posted by Igor Cicimov <ic...@gmail.com>.
Use mod_expires instead

Sent from my phone

On May 19, 2010 11:42 PM, "Pablo Garcia Melga" <ma...@gmail.com> wrote:

Hello,

 I'm struggling with a configuration that doesn't seems to work
I have an httpd 2.2.15 running on RHEL 5.3 loaded with mod_rewrite,
mod_headers, mod_expires and php


I have configured this rewrite rule
RewriteRule "/c([0-9]+)-([a-zA-Z/-]+)-p([0-9]+)(.*)"
"/nl_listado.php?categoria=$1&pagina=$3"

Works fine, no problem.
Now I want to remove all cache-related headers sent by the php and set my
own.
So I put these lines in the config.

<Files nl_listado.php>
Header unset set-cookie
Header unset Expires
Header unset cache-control
Header unset Pragma
Header set cache-control "public"
Header append cache-control "max-age=1200"
</Files>
<FilesMatch "/c([0-9]+)-(.*)">
Header unset set-cookie
Header unset Expires
Header unset cache-control
Header unset Pragma
Header set cache-control "public"
Header append cache-control "max-age=1200"
</FilesMatch>

Neither of these seems to work as expected, instead I get a mixed response.

This are the response headers without the sections

Cache-Control: no-store, no-cache, must-revalidate, post-check=0,
pre-check=0, no-cache
Expires: -1
Pragma: no-cache

And this are the response headers after I place the above configuration.

Cache-Control: public, max-age=1200, no-cache
Expires: -1
Pragma: no-cache


I've tried with different versions of httpd, also compiling the
modules statically, but I found no way to make this works.
The weird thing is that the mod_headers kicks in and append the
"public, max-age=1200" to the response, but doesn't remove the
no-cache, Expires and Pragma headers.
Any ideas ?



Regards, Pablo

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
  "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org