doudang4857
2013-04-01 07:49
浏览 40
已采纳

如何在Heroku上的Rails应用程序中的子URI上运行Wordpress博客

I have a rails application that needs a blog. I have looked at various rails cms and blog engines and none of them meet my needs. I would like to add Wordpress on a sub uri www.example.com/blog. My application is hosted on Heroku. I am able to install wordpress independently as a separate app on heroku and I have tried adding wordpress to the public folder with an .htaccess file like this:

RewriteEngine On  
RewriteRule ^([^\.]+[^/])$ http://%{HTTP_HOST}/$1/ [R=301,L]  
RewriteBase /  
RewriteCond RewriteCond %{REQUEST_URI} ^/blog.*$
RewriteCond %{DOCUMENT_ROOT}/-%2 -d  
RewriteRule ^(.*)$ -%2/$1 [QSA,L]  

but to no avail. I cant use reverse proxies because I would like to have SSO (and shared navigation bar etc and really dont want wordpress and my app to be "separate" applications on heroku) between the Rails app and the wordpress installation. Is there a way to achieve this

图片转代码服务由CSDN问答提供 功能建议

我有一个需要博客的rails应用程序。 我查看过各种rails cms和博客引擎,但都没有满足我的需求。 我想在子网站www.example.com/blog上添加Wordpress。 我的应用程序托管在Heroku上。 我能够在heroku上独立安装wordpress作为一个单独的应用程序,我尝试使用.htaccess文件将wordpress添加到公共文件夹,如下所示:

  RewriteEngine On 
RewriteRule ^  ([^ \。] + [^ /])$ http://%{HTTP_HOST} / $ 1 / [R = 301,L] 
RewriteBase / 
RewriteCond RewriteCond%{REQUEST_URI} ^ / blog。* $ 
RewriteCond%  {DOCUMENT_ROOT} /  - %2 -d 
RewriteRule ^(。*)$  - %2 / $ 1 [QSA,L] 
   
 
 

但无济于事。 我不能使用反向代理,因为我想在Rails应用程序和wordpress安装之间使用SSO(和共享导航栏等,并且真的不希望wordpress和我的应用程序在heroku上成为“独立”应用程序)。 有没有办法实现这个

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

2条回答 默认 最新

相关推荐 更多相似问题