Domain Setup
Serving your blog in the /subdirectory of your main domain
Serving your blog via a /subdirectory 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 /subdirectory 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 /subdirectory in blogstatic
In blogstatic, navigate to "Settings > Domains > /subdirectory" and enter your custom domain with the /subdirectory of your choice, in full.
Example: my-domain.com/blog
Without entering your custom domain.com/subdirectory
first, do not proceed to the next step.
Setting up your /subdirectory in Cloudflare
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 /subdirectory domain already set under "Settings > Domain > /subdirectory"
- Click "Deploy" and then on the pop-up "Save and deploy"
- Click "← blog" in the top-left corner of the page
- On the next screen, give it the name "blog"
- On your newly created Worker's page, click "Settings" (top menu) and then "Domains & Routes" (left-hand sidebar inside the "Settings" tab)
- On the Sidebar pop-up, click on "Route"
- Zone: Select yourdomain.com
- Route: Write yourdomain.com/blog* — do not forget the *
- blog must match your /subdirectory of choice
- If you are setting up your /subdirectory with "www" — add "www" in front of "yourdomain.com/blog*"
- Failure mode: 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.bmaker.app
Troubleshooting
- Make sure you have set up your /subdirectory under "Settings > Domain > /subdirectory" 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 /subdirectory possible.
Adding the IPs from above will remove this conflict.
Chat with us for any difficulties you may have in the process.