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

  • 写回答

2条回答 默认 最新

  • dqhgjay5753 2013-04-04 23:25
    关注

    I would take a look at wordpress-heroku

    As far as sub URI's, you start to make things more complex when it's not necessary. If you want you can run two Heroku apps, but instead of using folder paths, use a subdomain so your main app runs on www.example.com and your blog runs on blog.example.com. The use of subdomains is greatly respected in uses like this and makes things a lot easier.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 用visual studi code完成html页面
  • ¥15 聚类分析或者python进行数据分析
  • ¥15 逻辑谓词和消解原理的运用
  • ¥15 三菱伺服电机按启动按钮有使能但不动作
  • ¥15 js,页面2返回页面1时定位进入的设备
  • ¥50 导入文件到网吧的电脑并且在重启之后不会被恢复
  • ¥15 (希望可以解决问题)ma和mb文件无法正常打开,打开后是空白,但是有正常内存占用,但可以在打开Maya应用程序后打开场景ma和mb格式。
  • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝
  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?