• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved How to remove Cache-Control Use .htaccess?

v123shine

New Pleskian
Hi,

How to remove must-revalidate and max-age=0 from Cache-Control header using .htaccess?

And How to remove X-Powered-By PHP/5.6.24 using .htaccess?
I try using this code: Header unset X-Powered-By but still not work.

Can someone help me, please! Thanks

Note:
- I'm using Plesk 12.0.18
- PHP run as FastCGI
- Web Server Setting, using Smart static files processing with Serve static files directly by nginx.
 
Last edited:
Hi v123shine,

pls. be informed, that
How to remove must-revalidate and max-age=0 from Cache-Control header using .htaccess?
conflicts with the fact
- Web Server Setting, using Smart static files processing with Serve static files directly by nginx.
NGINX can't read ".htaccess" - files... you have to use "additional directives", when you use nginx.

Before giving additional suggestions to this question, can you pls. explain, why you would like to remove cache-control?


And How to remove X-Powered-By PHP/5.6.24 using .htaccess?
I try using this code: Header unset X-Powered-By but still not work.
To remove this information, consider to modify:

Code:
...
expose_php = off
...

at your depending PHP.ini - file(s).

Hint:
You could find it usefull, to use "sed", after you located your depending PHP.ini - file(s):

Examples:
Code:
find / -type f -name "*.ini" -exec grep -i -H "expose_php ="  {} \;
Code:
sed -i -e 's/expose_php = on/expose_php = off/' /etc/php/php.ini
 
Back
Top