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 and you can't get it to work, contact us and we'll help you.
Setting up your /subdirectory in BlogMaker
In BlogMaker, 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 "Compute Workers" > "Workers & Pages"
- On the next screen, click "Create"
- On the next screen, click "Start with Hello World!"
- On the next screen, give your worker a name, example: "blogmaker-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 BlogMaker and have your /subdirectory domain already set under "Settings > Domain > /subdirectory"
- Click "Deploy"
- Same page, top-left corner, Click "← blogmaker-blog" (or your Worker Name of choice)
- On the next screen, give your worker a name, example: "blogmaker-blog"
- On your newly created Worker's page, click "Settings" (top menu)
- Same page, to the right of "Domains & Routes", Click "+ Add"
- 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
- Click "Add Route"
Give it about 10 seconds, and visit yourdomain.com/blog to see your blog.
If your blog is not showing as expected even after a minute or so, refer to the Troubleshooting section below.
Troubleshooting
- Make sure you have set up your /subdirectory under "Settings > Domain > /subdirectory" in the BlogMaker 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.