You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: advanced/subpath/cloudflare.mdx
+53Lines changed: 53 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -82,3 +82,56 @@ async function handleRequest(request) {
82
82
83
83
Click on `Deploy` and wait for the changes to propagate (it can take up to a few
84
84
hours).
85
+
86
+
## Webflow custom routing
87
+
If you use Webflow to host your main site and want to serve Mintlify docs at `/docs` on the same domain, you'll need to configure custom routing through Cloudflare Workers to proxy all non-docs traffic to your main site.
88
+
89
+
<Warning>
90
+
Make sure your main site is set up on a staging domain before deploying this Worker, or visitors to your main site will see errors.
91
+
</Warning>
92
+
93
+
1. In Webflow, set up a staging domain for your main site like `staging.yoursite.com`.
94
+
2. Deploy your main site to the staging domain. This ensures that your main site remains accessible while you configure the Worker.
95
+
3. To avoid conflicts, update any absolute URLs in your main site to be relative.
96
+
4. In Cloudflare, select **Edit Code** and add the following script into your Worker's code.
97
+
98
+
<Tip> Replace `[SUBDOMAIN]` with your unique subdomain, `[YOUR_DOMAIN]` with your website's base URL, and `[STAGING_DOMAIN]` with your staging domain URL. </Tip>
0 commit comments