Skip to content

feat: redirect /sign-up to /signup#60468

Merged
joethreepwood merged 3 commits into
masterfrom
posthog-code/redirect-sign-up-to-signup
May 29, 2026
Merged

feat: redirect /sign-up to /signup#60468
joethreepwood merged 3 commits into
masterfrom
posthog-code/redirect-sign-up-to-signup

Conversation

@joethreepwood
Copy link
Copy Markdown
Contributor

Problem

Users (and external links) occasionally hit /sign-up instead of the canonical /signup. Today that path falls through to the catch-all and forces a login, instead of landing on the signup page.

Changes

  • Add a permanent (301) URL pattern in posthog/urls.py that redirects /sign-up (with or without trailing slash) to /signup, preserving the query string via Django's RedirectView(query_string=True).
  • The redirect is path-based, so it works for every subdomain (app., us., eu.) without per-host configuration — the host is preserved by the relative redirect.

How did you test this code?

I'm an agent. I added parameterized automated tests in posthog/test/test_urls.py covering both slash variants and with/without query strings, asserting a 301 and the correct Location header. I could not execute the test suite in the sandboxed environment (no hogli/flox/uv/Django installed), so CI will need to confirm the run.

Publish to changelog?

do not publish to changelog

Docs update

No docs change needed.

🤖 Agent context

  • Tool: PostHog Code (Claude Opus 4.7).
  • Considered handling the redirect at the load balancer / web server, but a Django URL pattern keeps the behavior consistent across local dev, self-hosted, and cloud, and is trivially testable.
  • Chose RedirectView with permanent=True, query_string=True so that signup links carrying ?email=… or campaign parameters survive the hop.
  • Inserted the route before the unauthenticated frontend routes and the catch-all so it matches first.

Created with PostHog Code

Adds a permanent (301) redirect from `/sign-up` (and `/sign-up/`) to the canonical `/signup` route, preserving any query string. The redirect is path-based so it works on every subdomain (app., us., eu.) without per-host configuration.

Generated-By: PostHog Code
Task-Id: 7e045c05-2e33-43c2-9dd1-fa2a1c36661a
@joethreepwood joethreepwood requested a review from ivanagas May 28, 2026 16:38
@joethreepwood joethreepwood marked this pull request as ready for review May 28, 2026 18:35
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 28, 2026

Reviews (1): Last reviewed commit: "Merge branch 'master' into posthog-code/..." | Re-trigger Greptile

@ivanagas
Copy link
Copy Markdown
Contributor

This one is a bit out of my area of expertise I think as we're messing with the router for the entire app which I'd be scared to break 😅

@ivanagas ivanagas removed their request for review May 29, 2026 12:10
@joethreepwood joethreepwood enabled auto-merge (squash) May 29, 2026 22:45
@joethreepwood joethreepwood merged commit 79d2150 into master May 29, 2026
199 checks passed
@joethreepwood joethreepwood deleted the posthog-code/redirect-sign-up-to-signup branch May 29, 2026 23:04
@deployment-status-posthog
Copy link
Copy Markdown

deployment-status-posthog Bot commented May 29, 2026

Deploy status

Environment Status Deployed At Workflow
dev ✅ Deployed 2026-05-29 23:26 UTC Run
prod-us ✅ Deployed 2026-05-29 23:39 UTC Run
prod-eu ✅ Deployed 2026-05-29 23:40 UTC Run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants