Skip to content

Commit d5e84d0

Browse files
committed
docs: structure why section
1 parent d28d99f commit d5e84d0

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

‎README.md‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,18 @@
2323

2424
## 💡 Why? <a name="why"></a>
2525

26+
### Today: you can't have both
27+
2628
Angular's prerendering (SSG) writes every route into its own folder: the route `blog/my-article` becomes `blog/my-article/index.html`.
27-
Static hosts see a folder and redirect `/blog/my-article` to `/blog/my-article/`, and the Angular router then removes the trailing slash again.
28-
Every direct visit (search engine, bookmark, shared link) starts with a redirect.
29+
Static hosts see a folder and redirect `/blog/my-article` to `/blog/my-article/`.
30+
So you have to choose:
31+
32+
- **Nice looking URLs, but redirects:** links, canonical tags and sitemap use `/blog/my-article`. Every direct visit (search engine, bookmark, shared link) starts with a 301/308 redirect to `/blog/my-article/`, and the Angular router then removes the trailing slash again.
33+
- **No redirects, but trailing slashes everywhere:** links, canonical tags and sitemap use `/blog/my-article/`. Pages answer with 200, but every URL ends with a slash, and the Angular router needs extra configuration to keep it.
34+
35+
### With this builder: both
2936

30-
With this builder, the same route becomes `blog/my-article.html`.
31-
Hosts like Cloudflare Pages serve that file under `/blog/my-article` directly, with status 200.
37+
The same route becomes `blog/my-article.html`, and hosts like Cloudflare Pages serve it under `/blog/my-article` directly, with status 200.
3238

3339
- **Nice looking URLs:** `/blog/my-article`, without a trailing slash, in links, in the address bar and in the server response alike.
3440
- **Flawless SEO:** every page answers directly with 200. Search engines see no redirect, and the URL they crawl is the same one your canonical tag, hreflang links and sitemap point to.

0 commit comments

Comments
 (0)