Domain Setup

Serving your blog in the /subfolder of your main domain

Serving your blog via a /subfolder on your main domain is accomplished via Cloudflare Workers.

This does NOT mean moving your domain to Cloudflare.

Please follow the guide on Setting up your domain in Cloudflare if you haven't already done so.


Feature Availability
The /subfolder feature is available on the "Expert" Plan and can be set up during the initial trial period. Visit our pricing page for all the details.


Note on Cloudflare
Cloudflare changes its flow quite often. If the steps below do not match what you're seeing in Cloudflare, contact us and we'll help you.

Setting up your /subfolder

In Cloudflare, from your Account page (not a specific domain page) —

  • On the left-hand sidebar, Click on "Workers & Pages" > "Overview
  • On the next screen, click "Create Worker"
    • On the next screen, give it the name "blog"
      • Click "Deploy" at the bottom of the screen
    • On the next screen, in the top-right corner, click "Edit Code"
    • Delete any existing code in the editor
    • Paste the following code in the editor
      • For the above "code" to show, you have to be logged in blogstatic and have your /subfolder domain already set under "Settings > Domain > /subfolder"
    • Click "Deploy" and then on the pop-up "Save and deploy"
    • Click "← blog" in the top-left corner of the page
  • On your newly created Worker's page, click "Settings" (top menu) and then "Triggers" (left-hand sidebar inside the  "Settings" tab)
    • Click "Add Route" (a bit below to the right)
    • For the Route: Insert yourdomain.com/blog* — do not forget the *
      • blog must match your /subfolder of choice
      • If you are setting up your /subfolder with "www" — add "www" in front of "yourdomain.com/blog*"
    • For the Zone: Select yourdomain.com
    • Also, click on the "Request limit failure mode" link and select "Fail open (proceed)"
      • This makes the URL /blog resolve to the homepage of yourdomain.com if you exceed the 100K requests per day

Give it a few seconds, and visit yourdomain.com/blog. It should show the content from your subdomain.bstatic.io

Troubleshooting

  • Make sure you have set up your /subfolder under "Settings > Domain > /subfolder" in the blogstatic Dashboard.
  • If you are just moving your domain to Cloudflare, you must give it up to 48–hours for the new Nameservers to resolve globally. Usually, it takes less than that (2–3 hours). But, that is the maximum that it can take.
  • Make sure the TLS/SSL on the domain level (in Cloudflare) is set to "Full". When Nameservers are resolving for the first time, Cloudflare tends to set back the TLS/SSL to flexible, which will not work.
    • Check this a few times. Cloudflare reverts it back when Nameservers are finally resolved. 
  • The main domain needs to be proxied via Cloudflare (orange toggle) on DNS management.

For Carrd users

Add the following DNS records in Cloudflare, and remove any other existing "A" ones:

Type Host Target
A @ 23.21.157.88
A @ 23.21.234.173

Recently, Carrd has issued new IP addresses that run via Cloudflare, which conflict with the Workers that make the /subfolder possible. 

Adding the IPs from above will remove this conflict.

Chat with us for any difficulties you may have in the process.