Let's say there's a domain, xyz.com, registered and managed at DNSSimple. A Rails application is configured to serve a website at https://www.xyzDOTcom. There's also a sub-domain, https://get.xyzDOTcom that is configured to serve several landing pages set up using Unbounce.
Now, the SEO guy wants all the Unbounce pages to be made accessible via https://www.xyzDOTcom/storage/PAGE. I implemented this by adding Rack's reverse-proxy to the config.ru.
Problem - The SEO guy also wants the existing https://get.xyzDOTcom/PAGE URLs to redirect (301) to their corresponding https://www.xyzDOTcom/storage/PAGE counterparts. Unbounce allows embedding custom Javascript blogs to its pages, so I tried window.location = , window.location.replace(), window.location.href =
etc, but they all resulted in an infinite redirect loop when trying to access https://get.xyzDOTcom/PAGE.
How do I achieve this 301 redirect of https://get.xyzDOTcom/PAGE to the corresponding reverse-proxy https://www.xyzDOTcom/storage/PAGE?