与phusion乘客和wordpress的Rails

我们在轨道上使用ruby开发了一个站点。 它有过

  1. 网站
  2. 移动应用程序的Web服务
  3. pipe理面板来pipe理数据。

我们开始使用WordPress来pipe理网站内容。 我们已经完成了发展,现在必须搬到生产。 这是wordpress在/ wordpress URI下工作的当前虚拟主机代码。

<Location /wordpress> PassengerEnabled off <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /wordpress/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /wordpress/index.php [L] </IfModule> </Location> 

我想让phusion乘客为/ admin和/ api URIs工作。 和/去wordpress。

我们可以根据URI更改文档根吗? 或者其他更好的解决scheme?

如果你在wordpress中使用'/'而不是/ wordpress /和/ admin和/ api作为乘客,我想你需要停止wordpress RewriteRule将请求传递给wordpress本身,在这种情况下,你可以使用负面的lookahead。 就像是:

 # Rewrite everything not starting with /admin or /api to wordpress controller RewriteRule ^/(?!admin|api) /wordpress/index.php [L] 

我是我的描述你的要求是不正确的,那么请扩展你的描述。