Heroku Rails app integrated a Bluehost Wordpress site
I have a Rails 4.0 app hosted on Heroku and a Wordpress site hosted on BlueHost.
I'd like to have certain paths forwarded, not redirected, from either the Rails app to Wordpress or the other way around. It doesn't really matter which is the 'master'.
Doing this all hosted on the same box with something like Apache is super easy, but not with my setup.
I've added Rack::Proxy to my Rails middleware stack and can successfully proxy specific paths, eg fullpath =~ /^main/.
I've setup the Wordpress site to be at www.insf.me and my Rails app on Heroku to be www.instructifyme.com.
When I hit www.instructifyme.com/main it forwards over to the Wordpress site, with /main/ stripped off.
Now the problems:
This ends with up, somehow, redirecting to www.insf.me. The proxy does work okay, but Wordpress seems to be doing the redirect.
I've alternately tried setting Site Address to www.instructifyme.com but no love there.
It seems I'm pretty close, but not close enough ;)
Any help, or totally alternate ideas, would be great.
Thanks - Charlie
Why?
Wordpress & RoR are both great, but are like oil & water - they don't mix very well
If you're trying to run two applications side-by-side, regardless of how, I'd highly recommend looking at why
The bottom line is that what you're asking goes against the Rails conventions of Convention over Configuration. You'll spend more time setting it up than actually making great functionality
CMS
If you need to have a CMS part to your Rails app, then I would endeavour to build one (especially as a simple blog app can be done in as little as 15 minutes)
You can probably replicate much of the base-functionality of WP in a couple of days, making it more robust & custom-specced to your own needs. It will also add to your experience as a Rails dev :)
Functionality
If you're looking to add extra functionality to Wordpress, you might want to consider writing a plugin for it. WP's main draw is extensibility, so writing a plugin would be a great addition to their community
If you're looking to include a Rails backend to your Wordpress site (maybe you have orders or something), I'd look at using an API to link the two systems. You can create a Rails API relatively simply, allowing you to send data to your Rails app directly from WP
链接地址: http://www.djcxy.com/p/60102.html