title: Blog redirection to directory in Heroku app is not working for blog post urls
body: <p>I followed <a href="https://hackernoon.com/wordpress-inside-a-ruby-on-rails-app-c324fbf39ad8" rel="nofollow noreferrer">this tutorial</a> in order to redirect my blog hosted on a subdomain (blog.botletter.com) to a directory of my Heroku rails app (<a href="https://www.botletter.com/blog/" rel="nofollow noreferrer">https://www.botletter.com/blog/</a>). </p>
  
  <p>The redirection works for the main page of the blog (/blog/) but does not for the articles URLs. </p>
  
  <p>I guess it's a problem of configuration within the Rails app but I can't find the mistake. Here is the log in Heroku:</p>
  
  <blockquote>
    <p>at=info method=GET path="/blog/invite-team-members/"
    host=www.botletter.com request_id=23b81c9a-e20b-4261-aea4-87adfb781554
    fwd="195.154.32.17" dyno=web.1 connect=0ms service=412ms status=500
    bytes=725 protocol=https</p>
  </blockquote>
  
  <p>Here is my config.ru file (I don't use username and passwork like in the tutorial as the blog is not using any access restriction):</p>
  
  <pre><code>require_relative 'config/environment'
  
  use Rack::ReverseProxy do
    reverse_proxy /^\/blog(\/.*)$/, 'https://blog.botletter.com$1', :timeout =&gt; 500, :preserve_host =&gt; true
  end
  
  run Rails.application
  </code></pre>
  
  <p>My routes:</p>
  
  <pre><code>get '/blog' =&gt; redirect("https://www.botletter.com/blog/")
  get '(*path)', to: 'application#blog', constraints: { subdomain: 'blog' }
  </code></pre>
  
  <p>My "blog" action in the application controller:</p>
  
  <pre><code>def blog
      redirect_to "https://www.botletter.com/blog#{request.fullpath.gsub('/blog','')}", :status =&gt; :moved_permanently
    end
  </code></pre>
  
  <p>Thanks for your help!</p>