This tutorial explains how to add custom domain to Notion pages for free. Notion lets you create and publish rich text documents. Thanks to the free personal plan that they recently released and now anyone can sign up and create those documents and publish them. By default, Notion publishes those documents on long URLs but if you want then you can host them on a custom domain with a workaround. There’s a very nice feature in Cloudflare called Workers that we can use to redirect your domain to any Notion page of your choice. This is easy to set up and both Notion and Cloudflare have a free plan and all you need is a registered domain.
Fruition is the name of the open-source script that I will be using here with Cloudflare Workers. The script will take care of the redirection process. Just generate the Workers script for you after filling out some parameters and then you are ready to go. You can even use this functionality to create a whole website using Notion. Other features of this Fruition script are: it can prettify the URLs and allows you to inject customs scripts. In just a few minutes, you can add a custom domain to any Notion page I will show how.
How to Add Custom Domain to Notion Pages for Free?
I am assuming that you have a Cloudflare and Notion account. You also need to have a working domain that you want to use for a target Notion page that you have created. So, just configure Cloudflare to use your Domain and you can see here how to do that. If you have a domain set up in Cloudflare already then just follow these steps.
Step 1: Get ready the Notion page that you want to use and then copy its URL. Next, you just go to the homepage of Fruition and then start the script generation process. Enter the URL of the Notion page and your domain there and then just copy the generated script.
Step 2: Now just go to your Cloudflare account and then go to Workers. Create a new worker there and give it any name you want as that doesn’t really matter.
Step 3: Remove all the existing code from there and then paste the script you copied in step 1. Save the worker and then just go to the main Cloudflare site.
Step 4: Now, you have to add a route for the worker. Go to your site in Cloudflare and then go to Workers. Click on “Add route” button and then enter your domain there with “/*” in the end. Select the worker script from the dropdown that you have already created and then just save the changes.
Step 5: At this point, you are done. You can now just enter your domain in the address bar of Chrome and the configured Notion page will be displayed. This is as simple as that and you can see the screenshot below to see it in action.
This is it. In this way, you can easily add a custom domain to any Notion page. You just have to take the help of Cloudflare Workers and then awesome Fruition script to get this done. However, I would like to mention one thing here that in Cloudflare, you need to make sure there is at least one A record is set up so the domain can be resolved. For this to work, you can just add 220.127.116.11 as the destination in the A record with your domain as name. For more basic instructions, you can turn to the main website of Fruition and see the steps listed there.
Notion is a great platform where you can create, save, and publish your notes and tasks or anything like that. And now with this great Fruition script, you get to host all those pages on a custom domain. The script supports creating different URLs as well and this is why you can create a whole website using Notion. Besides setting up a website, you can use this method to create your portfolio on Nation and add a custom domain for that.