Skip to content

[SD-1452] Add 301 redirect for site-prefixed URLs#760

Open
vincent-gao wants to merge 2 commits intodevelopfrom
feature/SD-1452-redirect-site-based-page
Open

[SD-1452] Add 301 redirect for site-prefixed URLs#760
vincent-gao wants to merge 2 commits intodevelopfrom
feature/SD-1452-redirect-site-based-page

Conversation

@vincent-gao
Copy link
Copy Markdown
Contributor

@vincent-gao vincent-gao commented Mar 31, 2026

Jira

https://digital-vic.atlassian.net/browse/SD-1452

details

  • /site-{id}/... path aliases are valid Drupal routes but should not appear in search engine results.
  • Added an EventSubscriber that 301 redirects anonymous requests from /site-{id}/... to the clean alias path (without the prefix)
  • Logged-in CMS users are not affected (detected via Drupal session cookie)
  • API requests (JSON API, Tide API) are not affected
❯ curl -I http://content-sdp.docker.internal:8888/api/v1/route\?path\=/site-4/best-start-best-life-reforms\&site\=4
HTTP/1.1 301 Moved Permanently
Server: openresty
Content-Type: text/html; charset=utf-8
Content-Length: 646
Connection: keep-alive
Date: Mon, 06 Apr 2026 22:58:19 GMT
location: /api/v1/route?path=%2Fbest-start-best-life-reforms&site=4
.
.
.
X-Sdp-App-Type: tide

@vincent-gao vincent-gao self-assigned this Mar 31, 2026
@vincent-gao vincent-gao force-pushed the feature/SD-1452-redirect-site-based-page branch 2 times, most recently from 38d63e1 to e453d23 Compare April 6, 2026 23:04
@vincent-gao vincent-gao force-pushed the feature/SD-1452-redirect-site-based-page branch from e453d23 to f410612 Compare April 7, 2026 01:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant