title: .htaccess - Set expire headers while url rewriting
body: <p>I'm rewriting using htaccess like:</p>
  
  <pre><code># ENABLE REWRITE
  Options +FollowSymLinks -MultiViews
  RewriteEngine On
  RewriteRule ^gallery/(.+)$ /image.php?image=$1 [L,QSA,NC]
  
  # EXPIRES CACHING
  &lt;IfModule mod_expires.c&gt;
  ExpiresActive On
  ExpiresByType image/jpg "access 1 year"
  ExpiresByType image/jpeg "access 1 year"
  ExpiresByType image/gif "access 1 year"
  ExpiresByType image/png "access 1 year"
  ExpiresByType text/css "access 1 month"
  ExpiresByType application/pdf "access 1 month"
  ExpiresByType text/x-javascript "access 1 month"
  ExpiresByType application/x-shockwave-flash "access 1 month"
  ExpiresByType image/x-icon "access 1 year"
  ExpiresDefault "access 1 month"
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>As you can see, I'm also setting expire period using .htaccess. Expire works if I remove line <code>RewriteRule ^gallery/(.+)$ /image.php?image=$1 [L,QSA,NC]</code>, but then obviously I will have problem with rewriting. How can I combine this two things to play well together?</p>
  
  <p>I'm on LiteSpeed server.</p>