: Can't change HTTP Vary header from PHP I have a test server running CentOS, and changing the Vary header there through PHP via: header('Vary: Accept'); works as expected (it's added to the
I have a test server running CentOS, and changing the Vary header there through PHP via:
header('Vary: Accept');
works as expected (it's added to the Accept-Encoding value that Apache already adds by itself). On the Ubuntu 10 LTS production server it does not. I tried to search the web for answers, but couldn't find any. Even setting:
header('Vary: Accept',true); // forces the header to be replaced
won't change the Vary header. Any help would be appreciated.
The server is running Apache/2.2.14 (Ubuntu) and PHP/5.3.2-1ubuntu4.26.
More posts by @Looi9037786
1 Comments
Sorted by latest first Latest Oldest Best
Check if you have the environment force-no-vary set to TRUE in your configuration, or simply try to set it to FALSE in your virtual host configuration. More details about this and how you should proceed, you can fine here: Environment Variables in Apache.
Also, there are modules that may override this header when the response is served to the client - for example, mod_deflate, but as you mentioned, you don't get this header back at all so my best guess remains the force-no-vary environment setting.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.