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 ofai-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:- You know your RankAI project ID (from the dashboard URL).
- You know the public hostname visitors use (
www, the apex domain, or both). - You have picked option A, B, or C for this domain.
- 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.
- 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 athttps://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.
1. Put the domain on Cloudflare
- Add the domain (zone) to Cloudflare and point the registrar nameservers to Cloudflare.
- For the public hostname (usually
wwwand/or the apex), set DNS to Proxied (orange cloud). - 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.- Sign in to the Cloudflare dashboard and select the zone (domain) for this site.
- In the left sidebar, open SSL/TLS → Overview.
- 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.
3. CMS prerequisites
- 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:- Create a Worker named exactly
rankai-landing. - Paste the script below and set
PROJECT_IDto the RankAI project ID from your dashboard. One Worker per project is fine. - Deploy the Worker.
- Handles GET and HEAD only; other methods go straight to your origin.
- Normalizes the path to a slug (lowercase; spaces become
-; onlya–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}.htmlwith 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-modifiedwhere present, and addsx-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:- Create a Cloudflare API token scoped to this zone with:
- Zone → Zone → Read
- Zone → Workers Routes → Edit
- Copy the Zone ID from the zone Overview sidebar.
- Paste the Zone ID and token into RankAI.
- 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}*
* matters so query strings like ?utm= still match.
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
- Project ID: the segment after
/dashboard/in the RankAI URL. - 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 innext.config.js (or next.config.mjs):
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
/). That would send every request to RankAI and take your existing site offline.
Nginx
Put this in the server block for your domain. ReplaceYOUR_PROJECT_ID. Change /lp/ if you pick another folder.
/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
Enablemod_proxy, mod_proxy_http, mod_rewrite, and SSL proxying, then add:
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.