需要将WP Blog与Heroku上的Rails App连接起来 [英] Need to link WP Blog with Rails App on Heroku

查看:76
本文介绍了需要将WP Blog与Heroku上的Rails App连接起来的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一位客户想要将他的Rails应用程序迁移到Heroku。然而,客户端也有一个与他在WordPress上运行的域相关的博客。目前,WordPress博客与Rails应用程序一起运行愉快,但一旦我们迁移到Heroku,显然是不可能的。

该应用的网址类似于 http://mydomain.com a>,博客的网址就像 http:// mydomain / blog



我意识到最好的长期解决方案是以Rails或Jekyll等Rails格式重做博客。但是从短期来看,继续托管WP博客的最佳方式是在哪里(或某处)使用Heroku来运行应用程序?客户不希望博客位于子域名上,而是因为搜索引擎优化的原因而停留在mydomain /博客上,也因为有博客流量。我有两个想法:
$ b


  1. 使用rack_rewrite或折射(或只是一个普通的老式301和Apache mod_rewrite) -Heroku)服务器将主网址从旧网站重定向到Heroku。在这种情况下,我可以让Wordpress博客愉快地运行。我认为??如果我这样做,是否有理由选择其中一个选项(rack_rewrite,refraction或mod_rewrite)?

  2. 切换DNS信息指向Heroku站点,然后使用301从博客重定向到旧站点。但是,我必须在子域上获取旧的(非Heroku)网站,并使用某种重写规则,因此它看起来不是子域。

这些方法中的任何一种都更可取,或者有另一种方法可以更容易地找到它吗?

解决方案

唯一可行的长期/可扩展解决方案是将博客永久托管在子域或不同域上并添加从mydomain.com/blog重定向到新位置(即:blog.mydomain.com)。



您需要一台服务器运行前端,如Apache / nginx在mydomain.com上提供混合后端,如Rails和Wordpress,这在Heroku上是不可能的。



不幸的是,这是你需要挖掘的地方作为顾问,对客户严格限制技术限制。

您的客户为什么要迁移到Heroku?是否有更大的目标背后,你可以完成不同的托管,你控制前端,可以混合在不同的后端?

I have a client who wants to migrate his Rails app to Heroku. However the client also has a blog associated with his domain that runs on WordPress. Currently, the WordPress blog is running happily alongside the Rails app, but once we migrate to Heroku, that clearly won't be possible.

The url for the app is like http://mydomain.com, and the url for the blog is like http://mydomain/blog.

I realize that the best long-term solution is to redo the blog in a Rails format like Toto or Jekyll. But in the short term, what is the best way to continue hosting the WP blog where it is (or somewhere) but use Heroku to run the app? The client doesn't want the blog to be on a subdomain, but to remain at mydomain/blog for SEO reasons and also since there is traffic to the blog. I have two ideas:

  1. Use rack_rewrite or refraction (or just a regular old 301 and Apache mod_rewrite) on the old (non-Heroku) server to redirect the main url from the old site to Heroku. In this case, I can just leave the Wordpress blog running happily where it is. I think?? Is there a reason to choose one of those options (rack_rewrite, refraction, or mod_rewrite) over the others if I do it this way?

  2. Switch the DNS info to point to the Heroku site, and then use a 301 redirect from the blog to the old site. But then I'll have to get the old (non-Heroku) site on a subdomain and use some kind of rewrite rules anyway so it looks like it isn't a subdomain.

Are either of these approaches preferable, or is there another way to do it that's easier that I'm missing?

解决方案

The only tenable long term/scalable solution would be to host the blog permanently on a sub-domain or different domain and add a redirect from mydomain.com/blog to the new location (ie: blog.mydomain.com).

You would need a single server running a front-end like Apache/nginx on mydomain.com to serve up mixed back-ends like Rails and Wordpress and that is not possible on Heroku.

Sadly, this is where you need to dig in as a consultant and be stern with your client about the technical limitations.

Why does you client want to migrate to Heroku? Is there a larger goal behind that you could accomplish with different hosting where you control the front-end and can mix in different back ends?

这篇关于需要将WP Blog与Heroku上的Rails App连接起来的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆