From cb31381734058f597392e11b992634a589e41b01 Mon Sep 17 00:00:00 2001 From: George Kalpakas Date: Wed, 20 Jun 2018 20:02:54 +0300 Subject: [PATCH] build(docs-infra): redirect removed webpack guide to `v5.angular.io` (#24595) The outdated webpack guide has been removed in #24478, but people might still try to access it (via direct links or search-engine results). Instead of returning 404, we will now redirect `/guide/webpack` to the archived version of the guide at `v5.angular.io/guide/webpack`. PR Close #24595 --- aio/firebase.json | 3 ++- aio/ngsw-manifest.json | 2 +- aio/tests/deployment/shared/URLS_TO_REDIRECT.txt | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/aio/firebase.json b/aio/firebase.json index b306c655ab..57fee90f7a 100644 --- a/aio/firebase.json +++ b/aio/firebase.json @@ -15,7 +15,7 @@ // A random bad indexed page that used `api/api` {"type": 301, "source": "/api/api/:rest*", "destination": "/api/:rest*"}, - // Guide renames + // Guide renames/removals {"type": 301, "source": "/docs/*/latest/cli-quickstart.html", "destination": "/guide/quickstart"}, {"type": 301, "source": "/docs/*/latest/glossary.html", "destination": "/guide/glossary"}, {"type": 301, "source": "/docs/*/latest/quickstart.html", "destination": "/guide/quickstart"}, @@ -25,6 +25,7 @@ {"type": 301, "source": "/guide/service-worker-getstart", "destination": "/guide/service-worker-getting-started"}, {"type": 301, "source": "/guide/service-worker-comm", "destination": "/guide/service-worker-communications"}, {"type": 301, "source": "/guide/service-worker-configref", "destination": "/guide/service-worker-config"}, + {"type": 301, "source": "/guide/webpack", "destination": "https://v5.angular.io/guide/webpack"}, // some top level guide pages on old site were moved below the guide folder {"type": 301, "source": "/styleguide", "destination": "/guide/styleguide"}, diff --git a/aio/ngsw-manifest.json b/aio/ngsw-manifest.json index 343fe4f675..8eed08fd18 100644 --- a/aio/ngsw-manifest.json +++ b/aio/ngsw-manifest.json @@ -18,7 +18,7 @@ "routing": { "index": "/index.html", "routes": { - "^(?!/styleguide|/docs/.|(?:/guide/(?:cli-quickstart|metadata|ngmodule|service-worker-(?:getstart|comm|configref)|learning-angular)|/news)(?:\\.html|/)?$|/testing|/api/(?:.+/[^/]+-|platform-browser/AnimationDriver|testing/|api/|animate/|(?:common/(?:NgModel|Control|MaxLengthValidator))|(?:[^/]+/)?(?:NgFor(?:$|-)|AnimationStateDeclarationMetadata|CORE_DIRECTIVES|PLATFORM_PIPES|DirectiveMetadata|HTTP_PROVIDERS))|.*/stackblitz(?:\\.html)?(?:\\?.*)?$|.*\\.[^\/.]+$)": { + "^(?!/styleguide|/docs/.|(?:/guide/(?:cli-quickstart|metadata|ngmodule|service-worker-(?:getstart|comm|configref)|learning-angular|webpack)|/news)(?:\\.html|/)?$|/testing|/api/(?:.+/[^/]+-|platform-browser/AnimationDriver|testing/|api/|animate/|(?:common/(?:NgModel|Control|MaxLengthValidator))|(?:[^/]+/)?(?:NgFor(?:$|-)|AnimationStateDeclarationMetadata|CORE_DIRECTIVES|PLATFORM_PIPES|DirectiveMetadata|HTTP_PROVIDERS))|.*/stackblitz(?:\\.html)?(?:\\?.*)?$|.*\\.[^\/.]+$)": { "match": "regex" } } diff --git a/aio/tests/deployment/shared/URLS_TO_REDIRECT.txt b/aio/tests/deployment/shared/URLS_TO_REDIRECT.txt index c4d9ee2d4f..e81bc5e706 100644 --- a/aio/tests/deployment/shared/URLS_TO_REDIRECT.txt +++ b/aio/tests/deployment/shared/URLS_TO_REDIRECT.txt @@ -178,6 +178,7 @@ /guide/service-worker-getstart /guide/service-worker-getting-started /guide/service-worker-comm /guide/service-worker-communications /guide/service-worker-configref /guide/service-worker-config +/guide/webpack https://v5.angular.io/guide/webpack /news https://blog.angular.io/ /news.html https://blog.angular.io/ /testing /guide/testing