3
3 Comments

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:

https://cloak.ist/blog/how-to-put-a-ghost-blog-at-a-subdirectory-using-cloudflare-workers/

  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
After 10M+ Views, 13k+ Upvotes: The Reddit Strategy That Worked for Me! 42 comments Getting first 908 Paid Signups by Spending $353 ONLY. 24 comments I talked to 8 SaaS founders, these are the most common SaaS tools they use 20 comments What are your cold outreach conversion rates? Top 3 Metrics And Benchmarks To Track 19 comments Hero Section Copywriting Framework that Converts 3x 12 comments Join our AI video tool demo, get a cool video back! 12 comments