0

I have a wordpress website that is using the wp default .htaccess:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php?nocache [L]
</IfModule>

My needs is to set the no-cache header just for the posts that begin with the same url, for example:

example.com/content/category_to_not_be_cached/foo_post
example.com/content/category_to_not_be_cached/bar_post

but i dont get how to do that using the .htaccess

Strae
  • 457
  • 1
  • 8
  • 22

1 Answers1

0

Example from Apache mod_headers documentation:

Header merge Cache-Control no-cache env=CGI
Header merge Cache-Control no-cache env=NO_CACHE
Header merge Cache-Control no-store env=NO_STORE

This could be wrapped in a <Directory> block or a series of <File> blocks to accommodate your needs (providing your host has enabled mod_headers).

danlefree
  • 2,923
  • 1
  • 19
  • 20