Skip to content

Commit 14c3d6b

Browse files
committed
fix(apps): set up redirect from material.angular.io (and all subdomains) to material.angular.dev (#2754)
PR Close #2754
1 parent 8ca74b8 commit 14c3d6b

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

apps/BUILD.bazel

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ nodejs_binary(
3030
"--project",
3131
"internal-200822",
3232
"--config",
33-
# TODO: Find a way to do this without relying on the copy_to_bin that works cross platform.
34-
"$$(rlocation dev-infra/apps/firebase.json)",
33+
"firebase.json",
3534
"emulators:start",
3635
],
3736
)
@@ -55,8 +54,7 @@ nodejs_binary(
5554
"--project",
5655
"internal-200822",
5756
"--config",
58-
# TODO: Find a way to do this without relying on the copy_to_bin that works cross platform.
59-
"$$(rlocation dev-infra/apps/firebase.json)",
57+
"firebase.json",
6058
"deploy",
6159
],
6260
)

apps/functions/dns-redirecting/index.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,15 @@ export const dnsRedirecting = functions.https.onRequest(
4646
if (hostname === 'blog.angular.io') {
4747
response.redirect(redirectType, `https://blog.angular.dev${request.originalUrl}`);
4848
}
49+
if (hostname === 'material.angular.io') {
50+
response.redirect(redirectType, `https://material.angular.dev${request.originalUrl}`);
51+
}
52+
if (hostname.endsWith('.material.angular.io')) {
53+
response.redirect(
54+
redirectType,
55+
`https://${request.subdomains[0]}.material.angular.dev${request.originalUrl}`,
56+
);
57+
}
4958

5059
// If no redirect is matched, we return a failure message
5160
response.status(404);

0 commit comments

Comments
 (0)