Skip to content

Commit 04b5623

Browse files
committed
Fix PostHog on Netlify
1 parent 42d8308 commit 04b5623

File tree

2 files changed

+13
-18
lines changed

2 files changed

+13
-18
lines changed

netlify.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[[redirects]]
2+
from = "/ingest/static/*"
3+
to = "https://us-assets.i.posthog.com/static/:splat"
4+
host = "us-assets.i.posthog.com"
5+
status = 200
6+
force = true
7+
8+
[[redirects]]
9+
from = "/ingest/*"
10+
to = "https://us.i.posthog.com/:splat"
11+
host = "us.i.posthog.com"
12+
status = 200
13+
force = true

next.config.js

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,6 @@ import "./src/env.js";
88
const config = {
99
eslint: { ignoreDuringBuilds: true },
1010
typescript: { ignoreBuildErrors: true },
11-
12-
async rewrites() {
13-
return [
14-
{
15-
source: "/relay-BxMI/static/:path*",
16-
destination: "https://us-assets.i.posthog.com/static/:path*",
17-
},
18-
{
19-
source: "/relay-BxMI/:path*",
20-
destination: "https://us.i.posthog.com/:path*",
21-
},
22-
{
23-
source: "/relay-BxMI/flags",
24-
destination: "https://us.i.posthog.com/flags",
25-
},
26-
];
27-
},
28-
skipTrailingSlashRedirect: true, // This is required to support PostHog trailing slash API requests
2911
};
3012

3113
export default config;

0 commit comments

Comments
 (0)