Skip to main content
RankAI builds each landing page. This guide shows how that page gets a URL on your website. Pick one setup before the first page goes live, and use that same setup for every landing page on the domain.
In RankAI: Open your project at rankai.ai/dashboard/<project>/…. The value after /dashboard/ is your project ID. Each landing page has a slug you set when you create or edit the page.

What RankAI publishes

  • Every landing page has a slug (for example virtual-try-on).
  • RankAI stores the HTML on a CDN at: https://cdn.rankai.ai/landing-pages/{projectId}/{slug}.html
  • Slugs are lowercase path segments. They may use letters, numbers, /, _, and -. Do not use a first path segment of ai-fix (reserved for other files on the CDN).
  • Use the slug in your setup. Do not rely on internal page IDs.

Compare setup options

Prerequisites checklist

Before you start, confirm:
  1. You know your RankAI project ID (from the dashboard URL).
  2. You know the public hostname visitors use (www, the apex domain, or both).
  3. You have picked option A, B, or C for this domain.
  4. For option A: you can change nameservers or DNS so the hostname is Proxied on Cloudflare, and you can create a Worker in that Cloudflare account.
  5. For option B or C: someone on your team can deploy app config or server config.

Option A: Cloudflare Worker routes (CMS sites)

Best for: Webflow, Shopify, Framer, and other sites that already use Cloudflare, or that can move DNS to Cloudflare. Outcome: Landing pages live at https://www.example.com/{slug} (or on the apex host). Other URLs still hit your CMS unchanged. When the project uses this architecture, RankAI creates, updates, and removes Worker routes as you publish, enable, or disable pages.
Option A changes DNS, SSL, and Cloudflare Workers on your live marketing domain. Have someone technical do this setup. A wrong nameserver, DNS target, SSL mode, or Worker config can take the site down or cause redirect loops.

1. Put the domain on Cloudflare

  1. Add the domain (zone) to Cloudflare and point the registrar nameservers to Cloudflare.
  2. For the public hostname (usually www and/or the apex), set DNS to Proxied (orange cloud).
  3. Keep the DNS target as your CMS host (for example Webflow’s CNAME), not an unrelated proxy hostname.

2. Set SSL/TLS to Automatic

This setting controls how Cloudflare talks to your CMS over HTTPS. Wrong mode is a common cause of redirect loops after you orange-cloud the hostname.
  1. Sign in to the Cloudflare dashboard and select the zone (domain) for this site.
  2. In the left sidebar, open SSL/TLS → Overview.
  3. Choose Automatic SSL/TLS (Cloudflare’s default for new zones). Cloudflare picks the strongest mode your origin supports—usually Full or Full (strict) for CMS hosts with a valid certificate.
If the zone uses Custom SSL/TLS instead, set the encryption mode to Full or Full (strict)—not Flexible. Flexible encrypts only the visitor-to-Cloudflare hop and often breaks CMS hosts that already redirect HTTP to HTTPS.
Flexible often causes redirect loops with Webflow, Shopify, and similar hosts. Prefer Automatic SSL/TLS, or Full / Full (strict) under Custom.

3. CMS prerequisites

Webflow: Connect your custom domain in Webflow first and wait until SSL shows Active. DNS should still point at Webflow’s target (for example a CNAME to cdn.webflow.com) while orange-clouded (orange-to-orange). If Webflow never “owns” the hostname, Cloudflare can show error 1014 (CNAME Cross-User Banned).
  • Shopify: Same orange-to-orange idea when Shopify documents custom domains behind Cloudflare. Cloudflare Workers may not run on /checkout. Be careful with Always Use HTTPS interactions after you change SSL mode.
  • Framer: Use this only where Framer documents custom domain / proxy support (typically paid plans).
  • Unofficial builders: Orange cloud can be flaky. Load the homepage several times before go-live.

4. Deploy the RankAI Worker once

In the same Cloudflare account as the zone:
  1. Create a Worker named exactly rankai-landing.
  2. Paste the script below and set PROJECT_ID to the RankAI project ID from your dashboard. One Worker per project is fine.
  3. Deploy the Worker.
What the Worker does:
  • Handles GET and HEAD only; other methods go straight to your origin.
  • Normalizes the path to a slug (lowercase; spaces become -; only a–z, 0–9, /, _, -). If the path does not already match those rules, it passes through.
  • Skips reserved first path segments such as ai-fix (other files under the same CDN folder).
  • Fetches https://cdn.rankai.ai/landing-pages/{PROJECT_ID}/{slug}.html with a 5-second timeout.
  • If the CDN returns anything other than 200 (missing objects often return 403, not 404), times out, or errors, it passes the request to your origin (fetch(request)).
  • When it serves RankAI HTML, it sets Content-Type: text/html; charset=utf-8, keeps cache/etag/last-modified where present, and adds x-rankai-worker: landing-page.
  • Uses passThroughOnException() so unexpected Worker failures still reach your site.

5. API token for RankAI automation

Create a Cloudflare API token so RankAI can manage Worker routes for this zone:
  1. Create a Cloudflare API token scoped to this zone with:
    • Zone → Zone → Read
    • Zone → Workers Routes → Edit
  2. Copy the Zone ID from the zone Overview sidebar.
  3. Paste the Zone ID and token into RankAI.
  4. Store the token somewhere safe. Cloudflare will not show the raw token again after you leave the create screen.

6. Routes RankAI creates

You usually do not create these by hand. After the Worker and API token are in place, RankAI adds a route automatically when you create or publish a landing page. Patterns look like:
  • example.com/{slug}*
  • www.example.com/{slug}*
The trailing * matters so query strings like ?utm= still match.
Use Worker Routes, not a Worker Custom Domain, when DNS for the hostname already exists. Attaching a Custom Domain on top of an existing CMS hostname can conflict with your DNS.
When RankAI configures route failure behavior, it must be Fail open (proceed) so that if Workers hit limits, the main site still reaches your CMS.

7. After setup

Option B: Static list / rewrites in your app

Best for: Next.js, Nuxt, and similar apps when you only expect a handful of landing pages and your team owns deploys. Your app keeps serving the rest of the site. For each landing page, you add an explicit rewrite or proxy: path on your site → RankAI CDN HTML. Pros: No Cloudflare Worker. Cons: Not automatic for every new page—each new RankAI page needs a code change and a deploy (unless you build a more advanced dynamic check against the CDN).

Find your project ID and slug

  1. Project ID: the segment after /dashboard/ in the RankAI URL.
  2. Slug: the path segment you set on the landing page in RankAI (must match the CDN file name without .html).

Next.js example

Add one rewrite per landing page in next.config.js (or next.config.mjs):
Deploy after you add or remove a rewrite. Visitors stay on your domain; HTML loads from the CDN. On another framework, do the same with that framework’s rewrite or a server route: one path on your site, proxied to https://cdn.rankai.ai/landing-pages/YOUR_PROJECT_ID/your-slug.html.
Advanced: Some teams add a dynamic fallback that checks the CDN for any unknown path. If the object is missing, the CDN may return 403, not 404—handle both when you design a fallback.

Option C: Reverse proxy under a folder

Best for: Nginx or Apache when you cannot put the marketing domain on Cloudflare orange cloud. All RankAI pages live under a fixed prefix such as /lp/. One proxy rule covers every slug under that folder, so new pages do not need a new rule. Tradeoff: URLs are not top-level paths on the marketing domain (unless you use option A or B). Example:
  • Works: https://www.example.com/lp/virtual-try-on
  • Does not work with this option alone: https://www.example.com/virtual-try-on
Tell RankAI which folder you chose so generated links can use it. Do not proxy the whole site (/). That would send every request to RankAI and take your existing site offline.

Nginx

Put this in the server block for your domain. Replace YOUR_PROJECT_ID. Change /lp/ if you pick another folder.
A request to /lp/virtual-try-on is fetched as /landing-pages/YOUR_PROJECT_ID/virtual-try-on.html on the CDN. Reload Nginx after you save the file.

Apache

Enable mod_proxy, mod_proxy_http, mod_rewrite, and SSL proxying, then add:
Restart Apache after the change.

How to choose

  • Choose A if you use a CMS (Webflow, Shopify, Framer, and similar) and can put the hostname on Cloudflare. This is the recommended self-serve path for those sites.
  • Choose B if the list of pages is short, your framework can rewrite a path, and your team can deploy when that list changes.
  • Choose C if DNS cannot move to Cloudflare orange cloud, you already terminate traffic on Nginx or Apache, and every landing page URL can include a folder such as /lp/.

FAQ and troubleshooting

Where do I find the project ID and slug?

Open the project in RankAI. The project ID is in the address bar after /dashboard/. The slug is the path you set on the landing page (for example virtual-try-on for /virtual-try-on or /lp/virtual-try-on).

Cloudflare error 1014

The hostname is not authorized on the CMS Cloudflare SaaS side (common with Webflow). Fix the CMS custom domain connection and the DNS target first, then keep the record orange-clouded.

Homepage intermittent timeouts on an obscure builder

Often an origin ↔ Cloudflare issue, not the RankAI landing Worker route. Test the homepage with Workers temporarily disabled on that hostname if you need to isolate the cause.

Route not live yet

Wait briefly after RankAI creates a route. In Cloudflare, check Workers → Routes for the correct zone and pattern (must end with *).

SSL redirect loops after setup

Confirm Cloudflare SSL/TLS is Automatic, or Custom set to Full / Full (strict)—not Flexible.

I was told to attach a Worker Custom Domain

If DNS for the marketing hostname already points at your CMS, use Routes instead. Custom Domains are for hostnames that should be owned by the Worker.

Can RankAI manage DNS for me instead?

Yes, as a RankAI-managed arrangement—not the default CMS self-serve path in this guide. Contact support if that is what you need.
Last reviewed: October 15, 2026.