Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.