I still don’t fully understand routes, so I apologize in advance.
I have a single rails app, but multiple domains pointing to different
directories for marketing reasons. I am looking for a way to have the
secondary domain point to the primarydomain.com/directory.
I would handle this in the upline webserver like Apache or Nginx with
url rewriting
The primary domain can catch all calls to the directory and 301 them
to the subdomain without passing the call through to Rails
Rewrite the subdomain/whatever and pass it to RAILS/directory/whatever
This way Rails only has to deal with the call to the directory and can
safely ignore the primary domain handling (and avoid changing routes)
Thanks, I figured this should be a Rewrite rule but was not familiar
enough with rails/routes to determine if I was making it more
complicated. I feel pretty confident in working with Apache.
Thanks much!
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.