2023-09-22

How do I redirect a subdomain to a subdirectory in primary domain serving as reverse-proxy?

I'll describe the current setup first followed by what I'd like to change it to.

Current Setup

All of the above works as expected.

What We Want

Now the marketing team, wanting to up the SEO game, wants blog.example.com/* to redirect to www.example.com/blog/*

What I've Tried So Far (with failure, of course)

  • Setup a Redirect on Flywheel dashboard to www.example.com/blog/$1 (expectedly resulted in infinite redirects).
  • Deleted A record from DNSSimple for blog.example.com (pointing to Flywheel IP address), and replaced with a CNAME to point to www.example.com (didn't work).

With the above given stack, how can the desired result be achieved? What you recommend a stack change to achieve the outcome?

Much thanks in advance, as I've spent a good few days trying to make this work.



No comments:

Post a Comment