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.
For this setup to work properly, your domain must run via Cloudflare.
Please follow our guide on Setting up your domain in Cloudflare.
After you set up your domain in Cloudflare, follow the instructions below and implement the required scripts for your blogstatic blog to run from your domain's /subfolder.
Setting up Cloudflare Worker subdomain**
**not to be confused with your blogstatic "subdomain"
Before setting up your Cloudflare Workers, you must create your Cloudflare Worker subdomain.
On your Cloudflare dashboard, on the left sidebar, Click on "Workers" > "Overview".
You will be asked to choose a subdomain for your Cloudflare Workers.
You can choose any available name.

After clicking the blue "Set up" button, you will be asked to choose a plan.
You can choose the "Free" plan as it provides 100,000 requests per day, which is plenty.
The last step is to verify your Email if you haven't done so already.
Setting up your /subfolder
- Click on "Workers" > "Overview
- From there, click the blue button "Create a Service"
- On the next screen, select "HTTP Handler"
- and click "Create Service
- On your newly created service, click the blue button to the right > "Quick Edit"
- Paste the following code into the editor
- Click "Save and Deploy" at the bottom of the editor
- Click the back button to go to your Service
- On the Service page, click on the "Triggers" tab
- Click "Add Route"
- Insert yourdomain.com/blog* for the route — do not forget the *
- blog must match your /subfolder of choice
- Select Zone 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 subdomain.bstatic.io
Setting up other functions
When your blog runs via Cloudflare Workers on your domain's /subfolder, we need to implement another script, so other functions (like newsletter signup, etc.) on your blog work properly.
- Click on "Workers" > "Overview
- From there, click the blue button "Create a Service"
- On the next screen, select "HTTP Handler"
- and click "Create Service
- On your newly created service, click the blue button "Quick Edit"
- Paste the following code into the editor
- Click "Save and Deploy" at the bottom of the editor
- Click the back button to go to your Service
- On the Service page, click on the "Triggers" tab
- Click "Add Route"
- Insert yourdomain.com/blog/internal/function for the route
- blog must match your /subfolder of choice
- Select Zone yourdomain.com
- Leave "Request limit failure mode" as is