I have a Rails app on Heroku and a separate WordPress blog hosted on GoDaddy. How can I route RailsApp.com/blog to the WordPress, while maintaining it as a subdirectory of the app?
相关问题
- Question marks after images and js/css files in ra
- Using :remote => true with hover event
- Display product ACF field value in Woocommerce tra
- Adding a custom button after add to cart button in
- How to add a “active” class to a carousel first el
相关文章
- wordpress新增页面如何个性化设置
- Right way to deploy Rails + Puma + Postgres app to
- AWS S3 in rails - how to set the s3_signature_vers
- how to call a active record named scope with a str
- select query in wordpress
- How to add a JSON column in MySQL with Rails 5 Mig
- “No explicit conversion of Symbol into String” for
- form_for wrong number of arguments in rails 4
Rails configuration
Add to Gemfile:
Now we want /blog and /blog/ to be directed to the Wordpress instance from the Rails app.
Add this to your config.ru right before you run the app:
In config/routes.rb add a route:
For Rails3.1+ (+Rails4), you should follow these: First, Add gem rack-proxy to Gemfile
gem "rack-proxy"
Then add file proxy.rb into Rails.root/lib like this:
Register proxy to middleware into config/application.rb:
Add this line into php file wp-config.php: