How to put your Ghost blog at a subdirectory for $5/m

After some pretty painful days, I managed to put Cloakist's new Ghost blog at the subdirectory https://cloak.ist/blog instead of having to put it at a subdomain like blog.cloak.ist.

(Thanks to this post from @Mathias458 for giving me a headstart.)

I wanted to do this because:

  • From what I read it's muuuuch better for SEO to build up value in my root domain.
  • Ghost is a really great tool for blogging and will keep me writing more than a less user-friendly tool.

I find it really weird that there's no easy way to do this, given what seems like a very clear problem. (Someone build it?)

Anyway -- key steps are:

  • Create a Ghost $5/m droplet with DigitalOcean
  • Put it at a subdomain to start off with
  • Change the Ghost blog URL to subdomain.rootdomain.com/blog
  • Set up a Cloudflare worker to show the subdomain content at rootdomain.com/blog, and change all URLs from subdomain to root domain
  • Use Cloudflare Firewall to restrict the subdomain to everyone apart from yourself and Cloudflare

For more details, including a far more detailed step-by-step guide and the exact commands and code to use, see my post here:


  1. 1

    Oh, very cool!

    Any way you can do this on a hosted plan?

    1. 1

      You mean hosted by Ghost? Hmm, I am not sure. I believe in theory it should be possible. You could just try following the guide I wrote for the Cloudflare Workers part and making some adaptations.

      Does the hosted plan allow you to change blog URL from subdomain.yoursite.com to subdomain.yoursite.com/blog? If not, you'd need to adjust my Cloudflare Worker script so that:

      These are relatively easy tweaks (I could give tips if you can't work it out). There might however be something else I'm missing about why doing this on a hosted plan will be difficult. I feel like there's a reason why this article says it's difficult.

      1. 1

        Thanks! I should probably just use the API and send posts to my new django site actually so the look stays consistent.

Trending on Indie Hackers
A Tool to Quickly Scaffold Custom SAAS Projects 17 comments We bootstrapped our SaaS to $50k MRR with just me and my co-founder - no employees 13 comments I bootstrapped an encyclopedia on nutrition to 7-figure ARR — AMA! 6 comments I just released my no-code SaaS product - show some love? 6 comments How to start a podcast in 2021? (Part 1: Idea & Format) 5 comments KatLinks launch is live on Product Hunt ⚡ 4 comments