SEO Best Practices with Cloudflare Workers, Part 2: Implementing Subdomains
Feb 15, 2019Michael Pinter

Summary
This post details the implementation of a Cloudflare Worker to act as a reverse proxy, enabling the routing of traffic from a subdirectory (e.g., `bobtopia.com/blog`) to a remotely hosted service (e.g., `bobtopia.coolghosthost.com`). It provides example JavaScript code for handling HTML document requests and asset requests, demonstrating how to configure the Worker with target hostnames and asset pathnames. A caveat regarding asset pathnames sharing names with root domain routes is also discussed.