From b61a1f2ad52b2aa9494e93ec2644359ca6e5d10e Mon Sep 17 00:00:00 2001 From: Joey Perrott Date: Tue, 29 Apr 2025 18:28:04 +0000 Subject: [PATCH 1/2] fix(apps): set up redirect from material.angular.io (and all subdomains) to material.angular.dev --- apps/BUILD.bazel | 6 ++---- apps/functions/dns-redirecting/index.ts | 9 +++++++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/apps/BUILD.bazel b/apps/BUILD.bazel index b6a77bcd9..67980b550 100644 --- a/apps/BUILD.bazel +++ b/apps/BUILD.bazel @@ -30,8 +30,7 @@ nodejs_binary( "--project", "internal-200822", "--config", - # TODO: Find a way to do this without relying on the copy_to_bin that works cross platform. - "$$(rlocation dev-infra/apps/firebase.json)", + "firebase.json", "emulators:start", ], ) @@ -55,8 +54,7 @@ nodejs_binary( "--project", "internal-200822", "--config", - # TODO: Find a way to do this without relying on the copy_to_bin that works cross platform. - "$$(rlocation dev-infra/apps/firebase.json)", + "firebase.json", "deploy", ], ) diff --git a/apps/functions/dns-redirecting/index.ts b/apps/functions/dns-redirecting/index.ts index a65ce1aa9..db65a49b3 100644 --- a/apps/functions/dns-redirecting/index.ts +++ b/apps/functions/dns-redirecting/index.ts @@ -46,6 +46,15 @@ export const dnsRedirecting = functions.https.onRequest( if (hostname === 'blog.angular.io') { response.redirect(redirectType, `https://blog.angular.dev${request.originalUrl}`); } + if (hostname === 'material.angular.io') { + response.redirect(redirectType, `https://material.angular.dev${request.originalUrl}`); + } + if (hostname.endsWith('material.angular.io')) { + response.redirect( + redirectType, + `https://${request.subdomains[0]}.material.angular.dev${request.originalUrl}`, + ); + } // If no redirect is matched, we return a failure message response.status(404); From 1c44dcd8c6d992e991d93ba15835c0b9df384254 Mon Sep 17 00:00:00 2001 From: Joey Perrott Date: Wed, 30 Apr 2025 13:55:51 +0000 Subject: [PATCH 2/2] fixup! fix(apps): set up redirect from material.angular.io (and all subdomains) to material.angular.dev --- apps/functions/dns-redirecting/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/functions/dns-redirecting/index.ts b/apps/functions/dns-redirecting/index.ts index db65a49b3..3b674c004 100644 --- a/apps/functions/dns-redirecting/index.ts +++ b/apps/functions/dns-redirecting/index.ts @@ -49,7 +49,7 @@ export const dnsRedirecting = functions.https.onRequest( if (hostname === 'material.angular.io') { response.redirect(redirectType, `https://material.angular.dev${request.originalUrl}`); } - if (hostname.endsWith('material.angular.io')) { + if (hostname.endsWith('.material.angular.io')) { response.redirect( redirectType, `https://${request.subdomains[0]}.material.angular.dev${request.originalUrl}`,