title: Rails routes: redirect a wild card route
body: <p>I have a website built in Ruby on Rails and a blog built in WordPress.  The url for the main site will be <code>example.com</code> and the url for the blog is <code>blog.example.com</code>.  Because of the way search engines index sites and the preference for a directory blog as opposed to a subdomain blog, I want to implement a permanent redirect so that <code>example.com/blog/anything</code> will redirect to <code>blog.example.com/anything</code> regardless of how many slashes or parameters the url contains.  So even <code>example.com/blog/a/b/c/d/e?google=true</code> should redirect to <code>blog.example.com/a/b/c/d/e?google=true</code></p>
  
  <p>So far the following works if there is only one directory after blog:</p>
  
  <pre><code>  get '/blog/:what', to: redirect('http://blog.codeundercover.com/%{what}')
  </code></pre>
  
  <p>I, however, need this to work regardless of what text comes after <code>/blog</code>.  How do I do this?</p>