Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: mod_headers, mod_rewrite & php header modification |
|
Author |
|
malevopfgm
Joined: 19 May 2010 Posts: 2
|
Posted: Wed 19 May '10 14:51 Post subject: mod_headers, mod_rewrite & php header modification |
|
|
Hello Lounge, I'm struggling with a configuration that doesn't seems to work
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 configuration on the apache
Cache-Control: public, max-age=1200, no-cache
Expires: -1
Pragma: no-cache
Any ideas ?
Regards, Pablo |
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
|
Back to top |
|
malevopfgm
Joined: 19 May 2010 Posts: 2
|
Posted: Wed 19 May '10 22:57 Post subject: |
|
|
Kind off,
Look at the original Headers, the Cache-Control seems to being replaced by the Header statement, but later it adds a no-cache. It might be that there are several ways to trigger this behavior.
I thought it was a misconfiguration related to the LoadModule order.
Thanks for the info, we'll see if this bugs gets corrected fast.
Regards, Pablo
BTW, do you have any idea of a workaround to this problem ? |
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Wed 19 May '10 23:36 Post subject: |
|
|
No, sorry I do not. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Sun 23 May '10 16:53 Post subject: |
|
|
The docs are updated! You could use something like always.
Code: |
Header always edit Cache-control no-cache "private, max-age=0"
|
Also read all the comments on Bug 49308 |
|
Back to top |
|
|
|
|
|
|