an ActionDispatch extension to handle subdomain redirects