How to add your custom domain using Bullet.so?
You can add your custom domain, like yourdomain.com or blog.yourdomain.com, to your Bullet site by following the steps below.
- Click on “Site Setting” and navigate to the domains section, and click on “Add Custom Domain”.
- Next, in the pop-up that opens, enter the domain you want to connect to.
- Now, copy & paste the CNAME records into your DNS settings by following the instructions provided. You will find the option to configure this in your domain registrar settings.
- Once you add the CNAME records, click on the “verify” button to verify if the records are configured properly.
Note: It can take anywhere from 5 minutes to 24 hours for the changes to reflect based on your DNS provider.
Legacy User
You can add your custom domain, like yourdomain.com or blog.yourdomain.com, to your Bullet site by following the steps below.
- Click on “Settings” and navigate to the domains section, and click on “Add Custom Domain”.

2. Next, in the pop-up that opens, enter the domain you want to connect to.
3. Now, copy & paste the CNAME records into your DNS settings by following the instructions provided. You will find the option to configure this in your domain registrar settings.
3. Now, copy & paste the CNAME records into your DNS settings by following the instructions provided. You will find the option to configure this in your domain registrar settings.
4. Once you add the CNAME records, click on the “verify” button to verify if the records are configured properly.
Note: It can take anywhere from 5 minutes to 24 hours for the changes to reflect based on your DNS provider.
Hosting in Root or Apex domain
Domain names without sub-domain are known as root or apex domains. For example, www.example.com or blog.example.com are called subdomains. But example.com is called the root/apex domain.
To configure a root domain in Bullet, your domain registrar must support
ALIAS or ANAME records or allow CNAME flattening.Check the following things:
How to host your bullet site on your root or apex domain.
- Check if you are able to set ALIAS or ANAME record and configure the “ @, root or host” to your site.pages.dev domain.
- If there is no ALIAS or ANAME record, simply add the CNAME record and point root to your -bullet.pages.dev domain and check if everything is working fine.
If Bullet fails to verify and recognize the custom domain even after 2 hours of configuring your records, it means that your DNS doesn't support CNAME flattening.
What if your DNS provider doesn't support ALIAS, ANAME or CNAME Flattening?
If your registrar doesn't support
ALIAS or ANAME records and doesn't allow CNAME flattening, then there is a couple of ways to overcome the limitation.- Easiest way: Point the www.example.com instead of apex domain. Most modern browsers don't display the www. in the address bar, and it would look very similar to apex domain.
- The other way is to point your domain nameservers (NS records) to a third-party DNS provider like Cloudflare and manage your DNS records there. Cloudflare is free to use and offers additional benefits beyond DNS services.
How to host your Bullet site as a subdirectory?
If you already have your website on other 3rd party tools and you want to use bullet only for specific use cases like Blog or a knowledge base, you can achieve that using reverse-proxy.
Note: Once you have configured your bullet site in a sub-directory, your internal links will not work in the bullet-pages.dev subdomain. However, there will be no issues in the domain that you have configured.
Step 1: Configuring your Sub-Directory
The first step is to configure your subdirectory in the bullet dashboard.
- Navigate to the domains section and click on the “Sub-Directory”.
- Next, enter the domain name and the sub-directory (Hosting path) details for your site.
Step 2: Setting up a reverse proxy
Now we have to set a reverse proxy to your primary domain and the sub-directory. You can use any one of the below options to setup your reverse proxy.
1. Cloudflare workers.
- Create a new Cloudflare worker, and add the below code.
- Now, In the 3rd line in the code add the current URL of your bullet site. You will find in your Site settings in your bullet dashboard.
- Next, In the 4th line of the code add the subrirectory(Hosting path) details you added in the Bullet dashboard.
addEventListener('fetch', (event) => { // Add your bullet subdomain below. Avoid trailing slash const bulletUrl = new URL(`https://your-url-bullet.pages.dev`) // Add sub-directory path where you want to see your bullet site in the next line. Avoid trailing slash/ const subdirectory = "/blog" const requestUrl = new URL(event.request.url) const pathname = requestUrl.pathname if (pathname.startsWith(`${subdirectory}/`) || pathname === subdirectory) { event.passThroughOnException() event.respondWith(fetch(`${bulletUrl.origin}${pathname.replace(subdirectory, "")}${requestUrl.search}`, event.request).then((response) => { const clonedResponse = new Response(response.body, response); if (clonedResponse.status === 308) { const redirectLocation = clonedResponse.headers.get("location"); const destination = (subdirectory + redirectLocation + "/").replace('//', '/'); redirectLocation && clonedResponse.headers.set("location", destination); } return clonedResponse; })) } else { event.respondWith(fetch(event.request)) } })
- After creating the worker and deploying, add the Worker Route, and set the path to https://example.com/blog\*
2. Nginx
- Add the below snippet in your nginx configuration(.conf) file.
- Update and replace your placeholder proxy\_pass details with your bullet domain.
location /blog/ { proxy_pass https://{{bullet-subdomain}}-bullet.pages.dev/; proxy_ssl_server_name on; }
3. Next.js
- Add the Below Code in your next.config.js file.
- Replace the placeholder data in the code below with appropriate details.
// next.config.js /** @type {import('next').NextConfig} */ const config = { rewrites() { const bulletUrl = new URL( `https://{{bullet-subdomain}}-bullet.pages.dev`, ).origin return [\\ {\\ source: '/blog',\\ destination: `${bulletUrl}`,\\ },// match all paths with extension eg .xml, .json etc.\\ {\\ source: '/blog/:slug(.*\\\\.[a-zA-Z]{2,5}$)',\\ destination: `${bulletUrl}/:slug`,\\ },// match all paths starting with /blog\\ {\\ source: '/blog/:path*',\\ destination: `${bulletUrl}/:path*/`,\\ },\\ ] }, } module.exports = config
By default, next.js will redirect URL with a trailing slash. Because of this, there will be a redirect for every blog post. To avoid this, we can add the below code in next.config.js file.
trailingSlash: true
Feel free to reach out to us in case you have any issues.
Adding redirects for your website links
- Click on “Site Settings” in the site dashboard
- Navigate to the “Domain” section.
- Scroll down to the redirects section and fill in your old and new URL details
- Next, click on the “Add Redirect” button and click Save.
Understanding the redirect types, rules, and formats:
Redirect Types
- Static Redirect: A simple URL-to-URL redirect without any dynamic values.
- Dynamic Redirects: A complex URL where you can use dynamic values instead of adding 10s or 100s of static redirects.
Supported redirect formats
Feature | Old Path | New Path | Notes |
Redirects | /home | / | 302 is used as the default status code. |
Splats | /blog/\* | /blog/en/:splat | Refer to Splats. |
Placeholders | /blog/:year/:month/:date/:slug | /news/:year/:month/:date/:slug | See Placeholders |
Force | /pagethatexists | /otherpage | Redirects are always followed, regardless of whether or not an asset matches the incoming request. |
Rules:
- If there are multiple redirects for the same source path, the top-most redirect is applied.
- Redirects happen before headers, so if a request matches rules in both files, the redirect will win out
- Static redirects need to be added first, and then the dynamic redirects.
- A project can have a maximum of 2,000 static redirects and 100 dynamic redirects for a total of 2,100 redirects.
- Each redirect declaration has a 1,000-character limit.
Splats
On matching, a splat (asterisk,
*) will greedily match all characters. You may only include a single splat in the URL.The matched value can be used in the redirect location with
:splat.Placeholder
A placeholder can be defined with
:placeholder_name- The colon indicates the start of a placeholder, and the name that follows may be composed of alphanumeric characters and underscores, :\w+.
- A placeholder with a given name can only be used once in the URL. Placeholders match all characters apart from the delimiter, which: when part of the host, is a period or a forward-slash; and when part of the path, is a forward-slash.
- The matched value can similarly be used in the redirect location with
:placeholder_name. By doing this, it allows for greater flexibility and usability for both users and developers.
Unsupported Redirects
The following redirects are not supported. Make sure not to use any of these.
Feature | Old Path | New Path |
Query Parameters | /shop?id=:id | /blog/:id |
Rewrites (other status codes) | /blog/\* | /blog/404.html |
Proxying | /blog/\* | |
Domain-level redirects |
If you have any questions, contact us directly in the live chat. We will guide you through.
Legacy User
- Click on “Settings” of your website in the Bullet dashboard and navigate to the “Redirects” section.
- Scroll down to the redirects section and fill in your old and new URL details
- Next, click on the “Add Redirect” button and click Save.
How to Configure Both Apex Domain and www, So Your Site Works in Both
If you have configured your site as www.yourdomain.com, you might expect that typing the apex domain (yourdomain.com) should also work.
That’s incorrect.
Your site should NOT work in both www and apex.
If your site works in both, Google will consider them duplicates. Google will index both variations, causing them to compete against each other, resulting in duplicate content and reduced rankings.
So, what should you do then?
If your site is www.yourdomain.com, when a user types yourdomain.com, it should redirect to the www version.
How to Set Up Domain Redirects
Most DNS providers offer options like Domain Forwarding or Domain Redirects. Here are some links for popular DNS providers:
Cloudflare
This is an example of how we’ve set redirect from www to apex domain for our own bullet.so website
Namecheap
GoDaddy
By setting up these redirects, you ensure that all traffic to your apex domain is seamlessly redirected to the www version, maintaining a single, consistent URL structure for your site. This helps avoid duplicate content issues and improves your site's SEO.
Restrict Your Site to a Custom Domain Only
To ensure that visitors only access your site through your custom domain and not through default subdomains (
-bullet.pages.dev or .bullet.site), add a JavaScript redirect to your site. This simple script will check the current domain and redirect users to the custom domain if they’re on a bullet site.Add the Redirect Script
Paste this JavaScript code into the Code > Body section. Replace
yourcustomdomain.com with your actual custom domain.<script> (function() { const currentHost = window.location.hostname; // Specify your custom domain here const customDomain = "yourcustomdomain.com"; // Check if the current host includes "-bullet.pages.dev" or ".bullet.site" if (currentHost.includes("-bullet.pages.dev") || currentHost.includes(".bullet.site")) { // Redirect to the custom domain while preserving the path and query parameters const newUrl = window.location.href.replace(currentHost, customDomain); window.location.replace(newUrl); } })(); </script>
For sub-directory sites
However if you are on a sub-directory sites, you can simply replace “yourcustomdomain.com” with something like “yourcustomdomain.com/blog”. It would work seamlessly.