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: docs/posts/2025/2025-12-06-running-multiple-apps-under-a-single-domain-with-vercel.md
+24-6Lines changed: 24 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,12 +18,12 @@ I own the `copdips.com` domain, and need to point it at several Vercel apps so t
18
18
* direct https://app1.vercel.app, still works as before
19
19
* direct https://app2.vercel.app, still works as before
20
20
21
-
In case of redirect, if `app1.vercel.app` serves an HTML file that contains `<link href="/styles.css">`, the browser should load `apps.copdips.com/app1/styles.css`, but not `apps.copdips.com/styles.css` (the root).
22
-
23
21
This is a standard **Multi-Tenant Routing with Context Awareness** scenario. To serve both the root domain (`app1.vercel.app`) and the subpath version (`apps.copdips.com/app1`) from the same deployment, each app must become host-aware-effectively detecting whether the request comes through the main router or directly and adjusting asset URLs and links accordingly.
24
22
25
23
<!-- more -->
26
24
25
+
In case of redirect, if `app1.vercel.app` serves an HTML file that contains `<link href="/styles.css">`, the browser should load `apps.copdips.com/app1/styles.css`, but not `apps.copdips.com/styles.css` (the root).
26
+
27
27
```mermaid
28
28
graph TD
29
29
User[User Browser]
@@ -106,7 +106,27 @@ On the main domain (`apps.copdips.com`), configure `vercel.json`:
MkDocsprojectsrunsmoothlyonVerceltoo. Forareferenceimplementation, check [fu-sen/Vercel-MkDocs](https://github.com/fu-sen/Vercel-MkDocs). The idea is simple: compile the static site so the output lives under `public/`, and Vercel serves that directory automatically.
0 commit comments