/plushcap/analysis/cloudflare/subdomains-vs-subdirectories-improved-seo-part-2

SEO Best Practices with Cloudflare Workers, Part 2: Implementing Subdomains

What's this blog post about?

In this text, the author discusses how to implement a subdirectory strategy using Cloudflare Workers instead of NGINX for routing traffic from subdirectories to remotely hosted services. The author provides an example script that proxies traffic from a subdirectory (bobtopia.com/blog) to a hosted Ghost blog endpoint (bobtopia.coolghosthost.com). The script handles requests for HTML documents and assets required by the document, ensuring that the browser still thinks it's on bobtopia.com. The author also mentions a caveat about the current implementation and suggests a more general solution involving modifying the blog asset block to handle asset requests without using paths. Finally, the author encourages readers interested in deploying Cloudflare Workers to reserve a workers.dev subdomain or add Workers to their existing website on Cloudflare.

Company
Cloudflare

Date published
Feb. 15, 2019

Author(s)
Michael Pinter

Word count
917

Language
English

Hacker News points
None found.


By Matt Makai. 2021-2024.