views:

13

answers:

1

He People.

I have a rails app running for multiple sites and it has a cache that looks like this: tmp/cache/adomain.com/the cached files

No this is not picked up by Apache (obviously) and i am trying to set it up in my httpd.conf. But I wasn't able to get it working.

This is something i tried:
< VirtualHost *:80 >
PassengerMaxPoolSize 20
PassengerPoolIdleTime 0
DocumentRoot /mnt/app/current/public
RewriteEngine On
RewriteCond /mnt/app/current/tmp/cache%{HTTP_HOST}%{REQUEST_URI} -f
< /VirtualHost>
But it doesn't seem to work! (of course I restarted apache with: apache2ctl restart) I googled a lot! but nowhere i did find a solution.

A: 

Looks to me like you're missing a RewriteRule declaration following your RewriteCond.

RewriteCond provides conditional matching of requests, but doesn't take action without a rule to do something.

Probably change to the following, your paths may vary:

RewriteCond /mnt/app/current/tmp/cache%{HTTP_HOST}%{REQUEST_URI} -f
RewriteRule ^/[^.]+$ /YOUR_CACHE_URI/%{REQUEST_URI} [QSA,L]
Winfield