【问题标题】:Apache rewriteCond Rails multi domain setup cacheApache rewriteCond Rails 多域设置缓存
【发布时间】:2010-07-08 11:57:02
【问题描述】:

他的人。

我有一个为多个站点运行的 Rails 应用程序,它有一个如下所示的缓存: tmp/cache/adomain.com/缓存文件

不,这不是 Apache (显然)接收到的,我正在尝试设置它 在我的 httpd.conf 中。但我无法让它工作。

这是我尝试过的:
< 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>
但这似乎不起作用! (当然我重新启动了apache:apache2ctl restart) 我google了很多!但我没有找到解决方案。

【问题讨论】:

    标签: ruby-on-rails apache2 passenger


    【解决方案1】:

    在我看来,您在 RewriteCond 之后缺少 RewriteRule 声明。

    RewriteCond 提供请求的条件匹配,但不采取行动,没有规则做某事。

    可能改成以下,你的路径可能会有所不同:

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

    【讨论】:

      猜你喜欢
      • 2011-08-04
      • 2012-06-24
      • 2011-09-30
      • 2012-02-29
      • 1970-01-01
      • 1970-01-01
      • 2023-04-02
      • 1970-01-01
      • 2010-10-01
      相关资源
      最近更新 更多