I have a rails 4 app that’s hosted on Heroku. Let’s say its domain is www.example.com.
I would like to set up a wordpress blog that’s hosted elsewhere. I would like the blog to live at www.example.com/blog.
That is, I want to use a subdirectory instead of a subdomain. This is for SEO purposes.
Could you please provide advice on how I can implement this?
UPDATE: This is a new site, and the blog isn’t set up yet. So there are not any incoming links to worry about breaking.
UPDATE #2: I tried using rack-reverse-proxy on heroku. The /blog/ pages were rendering fine. However, I would actually get redirected to blog.example.com/blog/ instead of keeping the displayed url www.example.com/blog/. I used the same code in the rack-reverse-proxy README. However, I can’t find any evidence of anyone having done this successfully with rails 4. I moved the server from heroku to EC2 and now I’m going to try some more stuff.
301 redirect requests for /blog to blog.example.com and setup a DNS entry for the blog subdomain.
Web bots/crawlers will update their indexes with a 301
You could also try something like https://github.com/jaswope/rack-reverse-proxy but judging by the nature of the question itself, that might be out of the scope of knowledge