Skip to content

Commit

Permalink
fix(aio): correctly handle redirects (angular#21416)
Browse files Browse the repository at this point in the history
- Fixes handling of some redirects by the ServiceWorker.
- Fixes redirect for old `NgFor` to new `NgForOf` URL.

Fixes angular#21318

PR Close angular#21416
  • Loading branch information
gkalpak authored and alexeagle committed Jan 12, 2018
1 parent f6db952 commit 3e3c22f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions aio/firebase.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
"public": "dist",
"cleanUrls": true,
"redirects": [
//////////////////////////////////////////////////////////////////////////////////////////////
// README:
// Redirects must also be handled by the ServiceWorker. If you add a redirect rule here,
// make sure the routing RegExp in `ngsw-manifest.json` is updated accordingly.
//////////////////////////////////////////////////////////////////////////////////////////////

// cli-quickstart.html, glossary.html, quickstart.html, server-communication.html, style-guide.html
{"type": 301, "source": "/docs/ts/latest/cli-quickstart.html", "destination": "/guide/quickstart"},
{"type": 301, "source": "/docs/ts/latest/glossary.html", "destination": "/guide/glossary"},
Expand All @@ -30,8 +36,9 @@
// cookbook/*.html
{"type": 301, "source": "/docs/ts/latest/cookbook/:cookbook.html", "destination": "/guide/:cookbook"},

// docs/ts/latest/api/*/index/*-type.html
{"type": 301, "source": "/docs/ts/latest/api/:package/index/:api-*.html", "destination": "/api/:package/:api"},
// docs/ts/latest/api/<package>/index/*-<type>.html (+ special case for `NgFor` which has been renamed)
{"type": 301, "source": "/docs/ts/latest/api/common/index/NgFor-directive.html", "destination": "/api/common/NgForOf"},
{"type": 301, "source": "/docs/ts/latest/api/:package/index/:api-*.html", "destination": "/api/:package/:api"},

// docs/ts/latest
{"type": 301, "source": "/docs/ts/latest", "destination": "/docs"},
Expand Down
2 changes: 1 addition & 1 deletion aio/ngsw-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"routing": {
"index": "/index.html",
"routes": {
"^(?!/docs/ts/latest|/guide/cli-quickstart|/styleguide).*/(?!e?plnkr)[^/.]*$": {
"^(?!/docs/ts/latest|/guide/(?:cli-quickstart|metadata|service-worker-(?:getstart|comm|configref))/?$|/styleguide).*/(?!e?plnkr)[^/.]*$": {
"match": "regex"
}
}
Expand Down

0 comments on commit 3e3c22f

Please sign in to comment.