Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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]

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

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

share|improve this question
up vote 0 down vote accepted

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).

share|improve this answer
Yes but i dont have to face with phisical files or directory, but with path aliases... – Strae Feb 14 '11 at 13:10
...but the Location directive, is what i was looking for! thanks – Strae Feb 14 '11 at 13:29

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.