Skip to content

Open-source status page, incident response and uptime monitoring

ok now?

Thibault Le Ouay Ducasseb0d1ed66b465
diff --git a/apps/status-page/src/middleware.ts b/apps/status-page/src/middleware.ts
index 4ffaf29cc..19545f86e 100644
--- a/apps/status-page/src/middleware.ts
+++ b/apps/status-page/src/middleware.ts
@@ -123,7 +123,7 @@ export default async function middleware(req: NextRequest) {
}
console.log({customDomain: _page.customDomain, host, expectedHost: `${_page.slug}.stpg.dev`})
- if (_page.customDomain && url.host !== `${_page.slug}.stpg.dev`) {
+ if (_page.customDomain && host !== `${_page.slug}.stpg.dev`) {
if (pathnames.length > 2 && !subdomain) {
const pathname = pathnames.slice(2).join("/");
const rewriteUrl = new URL(`/${_page.slug}/${pathname}`, req.url);
@@ -135,7 +135,7 @@ export default async function middleware(req: NextRequest) {
// const vercelURL = process.env.VERCEL_URL || "www.stpg.dev";
// console.log({newUrl: vercelURL})
if (pathnames.length > 2) {
- const pathname = pathnames.slice(2).join("/");
+ const pathname = pathnames.slice(1).join("/");
const rewriteUrl = new URL(
`${pathname}`,