How to rewrite and set headers at the same time in Apache
I have a directory of images that alternately be viewed directly in the browser, and other times downloaded. So, say I have a file /gallery/gal_4254.jpg. I want to make /download/gal_4254.jpg trigger a download of the image rather than view it. /download is empty, all the images are in /gallery. I can map requests to the download dir to the other files successfully <Directory /var/www/download> RewriteEngine on RewriteRule (.*)$ /gallery/$1 </Directory> and I already can force downloads in the gallery dir by setting <Directory /var/www/gallery/> ForceType "image/jpg" Header set Content